How to set image in JPanel or Panel in java Applet using Eclipse
For carrying out the most simplest way to add image in a JPanel in
java applet follow the below steps :
1.Save the Image in bin folder, where your Project is stored in
Workspace.
2.Confirm and check the exact type of Image file for Example it can
be .jpg or .jpeg or so on...
3.Open your notepad or if you're using java eclipse or any other java
working environment.
4.You need to include basic two packages i.e." java.awt.*;
" and " javax.swing.*; ".
5.extend the JApplet class to get the GUI.
6.You need to declare, initialize and add JLabel. Here JLabel will
contain image and this JLabel will be added to a JPanel. Now here JPanel is
initialized and added to a container , which is on JApplet.