This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;********************************************************************* | |
; INITIALISATIONS * | |
;********************************************************************* | |
init | |
;exemple | |
clrf PORTA ; Sorties portA à 0 | |
clrf PORTB ; sorties portB à 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JPanel panneau=new JPanel () ; | |
panneau . setLayout (new BorderLayout () ) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GridLayout experimentLayout = new GridLayout (3 ,3) ; | |
compsToExperiment . setLayout ( experimentLayout ) ; | |
compsToExperiment.add(new JButton("1")); | |
compsToExperiment.add(new JButton("2")); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CouleurAction implements ActionListener{ | |
private JLabel lblCouleur ; | |
public CouleurAction(JLabel lblCouleur){ | |
this.lblCouleur=lblCouleur ; | |
} | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
lblCouleur.setText( " Rouge " ) ; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); <≠≠ (⇤) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CouleurAction implements ActionListener{ | |
private JLabel lblCouleur ; | |
public CouleurAction(JLabel lblCouleur){ | |
this.lblCouleur=lblCouleur ; | |
} | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
JButton btnSource=(JButton)e.getSource(); <≠≠(⇤) | |
lblCouleur.setText ( btnSource.getText () ) ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 2"); | |
JButton btnBoutonR = new JButton("Rouge"); | |
JButton btnBoutonV = new JButton("Vert"); | |
JLabel lblcouleur = new JLabel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CouleurAction implements ActionListener{ | |
private JLabel lblCouleur ; | |
private JPanel pnlPanneau ; | |
public CouleurAction(JLabel lblCouleur ,JPanel pnlPanneau){ | |
this.lblCouleur=lblCouleur ; | |
this.pnlPanneau=pnlPanneau ; | |
} | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
JButton btnSource=(JButton)e.getSource(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface WindowListener | |
{ | |
void windowOpened ( WindowEvent e ) ; | |
void windowClosing(WindowEvent e); | |
void windowClosed ( WindowEvent e ) ; | |
void windowIconified (WindowEvent e) ; | |
void windowDeiconified (WindowEvent e) ; | |
void windowActivated(WindowEvent e); | |
void windowDeactivated(WindowEvent e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File f=new File("monProjet"+File.separatorChar+"fichier"); | |
File f=new File ("monProjet" ," fichier ") ; |
OlderNewer