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
|
JFrame frame=new JFrame();
JPanel panneau=new JPanel();
panneau.setLayout(null);
JLabel titre=new JLabel("titre");
titre.setBounds(300,10,40,10);
JLabel l1=new JLabel("label 1");
l1.setBounds(50,50,40,10);
JComboBox cb=new JComboBox();
cb.setBounds(100,50,60,20);
JButton b1=new JButton("Annuler")
b1.setBounds(80,200,50,20);
panneau.add(titre);
panneau.add(l1);
panneau.add(cb);
panneau.add(b1);
frame.setContentPane(panneau);
composant.setBounds(x,y,l,h);
x: la position horizontale
y:la position verticale
l: la largeur de composant
h: la hauteur de composant |
Partager