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
| import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.HashSet;
import java.util.Set;
import javax.imageio.ImageIO;
import javax.swing.*;
public class InterfaceFax extends JFrame implements ActionListener{
private JPanel haut = new JPanel();
private JPanel bas = new JPanel();
private JButton precedent = new JButton(new ImageIcon("images/Précédent.gif"));
private JButton suivant = new JButton(new ImageIcon("images/Suivant.gif"));
private JButton imprimer = new JButton(new ImageIcon("images/Imprimer.gif"));
public InterfaceFax(){
super("Gestion des fax");
initComposants();
this.setSize(500, 500);
this.setResizable(false);
this.setVisible(true);
}
public void initComposants(){
Container c = getContentPane();
precedent.addActionListener(this);
precedent.setMargin(new Insets(0,0,0,0));
precedent.setVisible(true);
haut.add(precedent);
suivant.addActionListener(this);
suivant.setMargin(new Insets(0,0,0,0));
suivant.setVisible(true);
haut.add(suivant);
imprimer.addActionListener(this);
imprimer.setMargin(new Insets(0,0,0,0));
imprimer.setVisible(true);
haut.add(imprimer);
c.add(haut, BorderLayout.NORTH);
c.add(bas, BorderLayout.SOUTH);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()== precedent ){
}
}
public static void main(String[] args){
InterfaceFax fax = new InterfaceFax();
fax.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
} |
Partager