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
|
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class Cinter extends JFrame{
JPanel panel = new JPanel();
JButton b1 = new JButton("bouton1");
JButton b2 = new JButton("bouton2");
JButton b3 = new JButton("bouton3");
JButton b4 = new JButton("bouton4");
JButton b5 = new JButton("bouton5");
JTextField infoField = new JTextField();
JTextArea logArea = new JTextArea();
/**
*
*/
private static final long serialVersionUID = 1L;
public Cinter()
{
GridBagLayout layout = new GridBagLayout();
panel.setLayout(layout);
panel.setSize(640,480);
panel.add(b1, new GBC(0,0).setFill(GridBagConstraints.HORIZONTAL));
panel.add(b2, new GBC(1,0).setFill(GridBagConstraints.HORIZONTAL));
panel.add(b3, new GBC(2,0).setFill(GridBagConstraints.HORIZONTAL));
panel.add(b4,new GBC(0,1,3,1).setFill(GridBagConstraints.HORIZONTAL));
panel.add(b5,new GBC(2,2,1,1).setFill(GridBagConstraints.HORIZONTAL));
/*
panel.add(selectServeur, new GBC(0,0,1,2).setInsets(0, 0, 400, 0).setWeight(100, 100));
panel.add(infoField,new GBC(1,0));
panel.add(selectAction, new GBC(1,1));
panel.add(logArea, new GBC(1,2));
*/
add(panel);
setSize(640, 480);
setVisible(true);
}
public static void main(String[] args)
{
new Cinter();
}
} |
Partager