Hello,
I am trying to create a JComboBox that would change pictures. My problem is that my method always returns null and it doesn`t return my image which is located in my package. Now I would like to know if java.net.URL is used only for getting images from web page or can I use it to get image from a local folder?
Code :public static ImageIcon createImageIcon(String path){ URL imgURL = Bikes.class.getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.out.println("Couldn't find file: " + path); System.out.println(path); return null; } }

