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
| JPanel east = new JPanel();
east.setBackground(Color.blue);
JPanel south = new JPanel();
south.setBackground(Color.red);
JPanel north = new JPanel();
north.setBackground(Color.white);
JPanel west = new JPanel();
west.setBackground(Color.cyan);
JPanel center = new JPanel();
center.setBackground(Color.orange);
container.add(north,BorderLayout.NORTH);
container.add(center,BorderLayout.CENTER);
container.add(east, BorderLayout.EAST);
container.add(south,BorderLayout.SOUTH);
container.add(west,BorderLayout.WEST);
north.add(label);
south.add(label_txt_field,BorderLayout.SOUTH);
south.add(jtf,BorderLayout.SOUTH);
GridLayout glcenter = new GridLayout(3, 3);
center.setLayout(glcenter);
center.add(new JLabel("combo"));
center.add(combobox);
center.add(checkbox3);
JLabel jtf1L = new JLabel("jtf1");
center.add(jtf1L);
center.add(jtf1);
bouton.setSize(42, 42);
center.add(bouton);
center.add(new JLabel("jtf2"));
center.add(jtf2);
GridLayout gleast = new GridLayout(4, 2);
east.setLayout(gleast);
east.add(radio1,BorderLayout.NORTH);
east.add(radio2,BorderLayout.SOUTH);
GridLayout glwest = new GridLayout(4, 2);
west.setLayout(glwest);
west.add(checkbox1,BorderLayout.NORTH);
west.add(checkbox2,BorderLayout.SOUTH); |
Partager