public class vmp_frame extends JComponent {
JFrame VMP = new JFrame("Vmp" );
JPanel pane = new JPanel();
JButton Courbe = new JButton("Courbes" );
JButton Quitter = new JButton ("Quitter" );
public vmp_frame(){
VMP.setSize(1024,768);
VMP.setLocationRelativeTo(null);
VMP.setResizable(false);
VMP.add(pane);
pane.add(Courbe);
pane.add(Quitter);
VMP.setVisible(true);
ferme f=new ferme();
Quitter.addActionListener(f);
Calcul.addActionListener(cv);
courbevmp cbv = new courbevmp(this);
Courbe.addActionListener((ActionListener) cbv);
}
}
class ferme implements ActionListener{
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
}
}
class courbevmp implements ActionListener{
private vmp_frame vmp1;
public courbevmp (vmp_frame vmp2){
vmp1=vmp2;
}
public void actionPerformed(ActionEvent arg0) {
vmp1.g.drawLine(0, 0, 500, 500);