File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to add images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to add images" Watch "How to add images" New topic

How to add images

Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
Pls suggest me what we can use to add images to panels and display them in an application.
It would be helpful if somebody could provide the names of the widgets.

Joined: Sep 06, 2001
Posts: 22
Try this:
Icon imageIcon = new ImageIcon("MyImage.jpg");
JPanel myPanel = new JPanel();
myPanel.add(new JLabel(imageIcon));
I agree. Here's the link:
subject: How to add images
It's not a secret anymore!