Sign in with
Sign up | Sign in
Your question

Java Image help

Last response: in Applications
January 7, 2012 1:10:55 PM

Hi am rather new at java so i am i little stuck with importing images into my java GUI`s.Can someone please give me the correct code for the path of a image and how import it.

More about : java image

a b L Programming
January 7, 2012 9:38:12 PM

I'm assuming your using Swing. Try this stack overflow post for adding an image to a JPanel. The image path can just be a string - just the path of the file system e.g.
  1. c:/myImages/myImage.png