If it's a small image, you can load it into an ImageIcon and then pass it into the constructor of a JLabel. Then you can place the JLabel in your JPanel.
Just make sure that if you load the image using Toolkit.getImage() you need to wait for it to load using a MediaTracker... ;) > -----Original Message----- > From: Discussion list for Java 2D API > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Friday, November 16, 2007 5:46 PM > To: [EMAIL PROTECTED] > Subject: [JAVA2D] how to draw an image on a JPanel > > how to draw an image on a JPanel? > > > This is a very newbie question but I have already searched > the web looking for a solution and I have not found the > answer. I have seen how to draw it over a JFrame but I dont > understand how to put it on a JPanel. > > Thanks in advance > [Message sent by forum member 'renzord' (renzord)] > > http://forums.java.net/jive/thread.jspa?messageID=245886 > > ============================================================== > ============= > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body of the message "signoff JAVA2D-INTEREST". > For general help, send email to [EMAIL PROTECTED] and > include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
