Skip to content

Instantly share code, notes, and snippets.

@anymaniax
Created May 26, 2016 14:35
Show Gist options
  • Save anymaniax/38a91a3db841c552b9fcc0efc5fb5e43 to your computer and use it in GitHub Desktop.
Save anymaniax/38a91a3db841c552b9fcc0efc5fb5e43 to your computer and use it in GitHub Desktop.
public class FrmFenetre extends JFrame{
public frmFenetre (){
JPanel pnlPanneau=new JPanel () ;
this.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE ) ;
this.setContentPane ( pnlPanneau ) ;
this.setSize (300 ,200) ;
this.setTitle("Exemple 1");
JButton btnBoutonR=new JButton("Rouge") ;
JLabel lblCouleur=new JLabel () ;
btnBoutonR.addActionListener(new CouleurAction(lblCouleur)); <≠≠ (⇤)
pnlPanneau.add(btnBoutonR) ;
pnlPanneau.add(lblCouleur) ;
}
public static void main(String [] args) {
FrmFenetre maFenetre = new FrmFenetre() ;
maFenetre . s e t V i s i b l e ( true ) ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment