I want to upload an Image into a Jpanel ..
Actually I want to do the following:

1.Thw User Clicks a jButton
2. A window will be opened by which he/she can choice a image
3. The selected image will be positioned into the Jframe

provide me some tutorials or help so that I can do the above :yawn:

Recommended Answers

All 2 Replies

Hi,

1 => Add a button with an action listener
2 => in the action listener open a JFileChooser so the user can choose the file
3 => Add a JLabel to the JFrame and call its setImage(new ImageIcon("thepathtoyourimage"));

Kind regards,
Joe

Sun's Swing tutorials covers everything you need for this.

Be a part of the DaniWeb community

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