1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
JFrame fen=new JFrame("Fenêtre");
Container cont=fen.getContentPane();
cont.setLayout(new GridBagLayout());
GridBagConstraints contrainte=new GridBagConstraints();
//Image du Pendu
JPanel gauche=new JPanel();
contrainte.fill=contrainte.WEST;
cont.add(gauche,contrainte);
JLabel imagegauche = new JLabel( new ImageIcon( "imageg.jpg"));
gauche.add(imageg,contrainte);
//Saisie du caractère
JPanel droite=new JPanel();
contrainte.fill=contrainte.EAST;
cont.add(droite,contrainte);
JLabel imagedroite = new JLabel( new ImageIcon( "imaged.jpg"));
droite.add(imaged,contrainte);
fen.setBounds(0, 0, 900, 900);
fen.setVisible(true);
fen.setDefaultCloseOperation(fen.EXIT_ON_CLOSE); |
Partager