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
|
private JPanel SaisieHDPanel(){
JPanel panel = new JPanel();
panel.setBackground(Color.LIGHT_GRAY);
SpringLayout layout = new SpringLayout();
panel.setLayout(layout);
panel.setLayout(new GridLayout( 1,2));
JLabel DiLabel = new JLabel("Di :");
panel.add(DiLabel);
Object[] elements = new Object[]{"1","2","3","4","5","6"};
liste1 = new JComboBox(elements);
panel.add(liste1);
Object[][] donnees = {
{"Johnathan", "Sykes" },
{"Nicolas", "Van de Kampf" },
{"Damien", "Cuthbert",},
{"Corinne", "Valance"},
{"Emilie", "Schrödinger"},
{"Delphine", "Duke"},
{"Eric", "Trump"},
};
String[] entetes = {"Prénom", "Nom"};
JTable tableau = new JTable(donnees, entetes);
tableau.add(new JScrollPane(tableau), BorderLayout.CENTER);
//SpringUtilities.makeCompactGrid(panel, 1, 2, 20, 9, 10, 50);
return panel;
} |