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
| import javax.swing.*;
import java.awt.*;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new JFrame("Test");
frame.setSize(500, 500);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new GridBagLayout());
frame.getContentPane ().add(panel, BorderLayout.NORTH);
GridBagConstraints c = new GridBagConstraints();
JLabel label1 = new JLabel ("Bonjour et bienvenu dans TEST !");
c.gridx = 0;
c.gridy = 0;
c.insets = new Insets(10,10,10,10);
panel.add(label1, c);
JLabel label2 = new JLabel ("Remplissez les champs suivants :");
c.gridx = 0;
c.gridy = 1;
panel.add(label2 , c);
JLabel id = new JLabel("ID de l'aérodrome : ");
c.gridx = 0;
c.gridy = 2;
panel.add(id , c);
JTextField label3 = new JTextField ("Saisissez ici ");
c.gridx = 0;
c.gridy = 3;
panel.add(label3 , c);
JLabel label4 = new JLabel ("Avion :");
c.gridx = 0;
c.gridy = 4;
panel.add(label4 , c);
JTextField label5 = new JTextField ("Saisissez ICI");
c.gridx = 0;
c.gridy = 5;
panel.add(label5 , c);
JButton bouton = new JButton("Rapport");
c.gridx = 1;
c.gridy = 6;
panel.add(bouton , c);
}
} |
Partager