can anybody help m in displaying an image file into GUI ?basic please bcoz i m newbie TQ

Recommended Answers

Easiest way is to read the image file ito an ImageIcon, then simply use that in a JLabel

Jump to Post

All 3 Replies

If you want to use JLable then it is better to show image in you GUI.
If you need help in how to set image to JLable than please check the link

Yes use JLable is best and easy way for displaying image in your GUI
If you dont know how to set image to jLable then see this code will help you:

JLabel label = new JLabel();
label.setIcon(new javax.swing.ImageIcon(getClass().getResource("your img file path")));

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.