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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| public class InterfConf extends JFrame implements ActionListener {
public JPanel panelhaut;
public JPanel panel;
public JPanel panelbutt;
public JButton suiv;
public JButton prec;
public JButton annul;
public JLabel labhaut;
public JLabel labconf;
public JLabel labsupp;
public JTextField fconf;
public JTextField fsupp;
public InterfConf(){
initComponents();
}
public void initComponents(){
panel=new JPanel();
panelbutt=new JPanel();
suiv=new JButton("Next");
prec=new JButton("Back");
annul=new JButton("Cancel");
labconf=new JLabel("Conf :");
labsupp=new JLabel("Sup:");
fconf=new JTextField();
fsupp=new JTextField();
Container contentPane = getContentPane();
contentPane.setLayout(null);
suiv.addActionListener(this);
prec.addActionListener(this);
annul.addActionListener(this);
panel.add(labconf);
panel.add(labsupp);
panel.add(fconf);
panel.add(fsupp);
labconf.setBounds(20, 40, 80, 20);
labsupp.setBounds(20, 85, 70, 20);
fconf.setBounds(110, 40, 80, 20);
fsupp.setBounds(110, 85, 80, 20);
contentPane.add(panel);
panel.setBounds(50, 70, 310, 150);
panelbutt.add(prec);
panelbutt.add(suiv);
panelbutt.add(annul);
contentPane.add(panelbutt);
panelbutt.setBounds(100, 250, 310, 50);
setSize(400, 350);
setLocation(310, 100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if( (JButton) e.getSource() == suiv )
{
new InterfCarac().setVisible(true);
this.dispose();
}
else if( (JButton) e.getSource() == prec ){
new InterfTool().setVisible(true);
this.dispose();
}
else if( (JButton) e.getSource() == annul ){
System.exit(0);
}
}
} |
Partager