I have a JPanel (which I created using netbeans)and I need to load image in it, based on selection on previous page. Could anyone suggest how to do that. Also is JPanel the best way to do what I am trying to do, or I could do something else ?
Efforts appreciated thanks!!
The easiest way to display an image is to use a
JLabeland call itssetIconmethod (or its constructor). The icon can be loaded using one of the constructors of theImageIconclass.See http://download.oracle.com/javase/tutorial/uiswing/components/label.html for an example.