comment inserer une image JPG dans un JFrame

voici mon JFrame

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
 
 
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
 
 
public class test extends JFrame {
	protected static test  SNF=null;
	public static Container conteneur=null;
	JPanel jp;
	JButton jB;
	JButton jBtest;
	private JTextField jtxt;	
	public static test HSW;
 
 
	protected test(){
			setLocation(200,50);
	        setSize(new Dimension(200, 200));
	        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        setTitle("Saisir nom");
	        conteneur=this.getContentPane();
	        conteneur.setLayout(null);
	        conteneur.setBackground(new Color(255,255,255));
	        jtxt = new JTextField("Votre Nom");
	        jtxt.setPreferredSize(new Dimension (80, 20));
	        jtxt.setBounds(40,50,120,20);
	        this.conteneur.add(jtxt);
	        System.out.println(jtxt.getText());
	        jB=new JButton();
	        jBtest=new JButton();
 
	        jB.setText("OK");
 
 
	        jB.setBounds(40,110,120,20);
	        jBtest.setBounds(300,110,120,20);
 
	        jB.addActionListener(new ActionListener(){
	        		public void actionPerformed(ActionEvent ev){
	        			Partie(ev);
	        			}
	        		}
	   		);
 
	        this.conteneur.add(jB);
	        this.conteneur.add(jBtest);
 
	}
 
	public void Partie(ActionEvent ev){
		System.out.println(jtxt.getText());	 
	 }	    	        		
 
 
}