voia je suis débutant en java et jessai de faire une calculatrice toute simple
le pb c linterface graphique
je narriva pas à redimensionner un label .... ou un jlabel ... mais ou est la vrai différence ?
voila un extrait du code !
si vs avez une idée ce seré sympa .. jprépare ca pour mon bts
--------------------------------------------------------------
this.setBounds(300,300,300,300);
this.setBackground(Color.LIGHT_GRAY);
PClavier = new JPanel();
PClavier.setLayout(new GridLayout(4,4,8,8));
PClavier.setBackground(Color.cyan);
addButton("7", this);
addButton("8", this);
addButton("9", this);
addButton("/", this);
addButton("4", this);
addButton("5", this);
addButton("6", this);
addButton("*", this);
addButton("1", this);
addButton("2", this);
addButton("3", this);
addButton("-", this);
addButton("0", this);
addButton(".", this);
addButton("=", this);
addButton("+", this);
this.add(PClavier, BorderLayout.CENTER);
Result = new Label("" );
Result.setBackground(Color.white);
Result.setBounds(100,100,100,100);
// Options du panel PResult
JPanel PResult = new JPanel();
PResult.setLayout(new FlowLayout());
PResult.setBackground(Color.pink);
PResult.add(Result);
this.add(PResult,BorderLayout.NORTH);
--------------------------------------------------
merci