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
| import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Cadre extends JFrame{
JPanel boiteBoutonsDéplacements=new JPanel();
JPanel boiteBoutonsJeu=new JPanel();
JPanel panneauDessin=new JPanel();
Cadre(){
setLayout(new BorderLayout());
getContentPane().add(boiteBoutonsDéplacements,BorderLayout.EAST);
getContentPane().add(boiteBoutonsJeu,BorderLayout.SOUTH);
getContentPane().add(panneauDessin,BorderLayout.NORTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Graphics zone=boiteBoutonsDéplacements.getGraphics();
boiteBoutonsDéplacements.setBackground(Color.green);
}
public static void main(String [] args){
JFrame cadreglobal=new JFrame("jeu_v1");
cadreglobal.setSize(300,300);
cadreglobal.setVisible(true);
}
} |
Partager