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
|
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
class Fen extends JFrame
{
public Fen(String Titre)
{
super(Titre);
setVisible(true);
setSize(600,480);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JTextField Saisie1 = new JTextField();
add(Saisie1);
Saisie1.setText("celui ci");
JButton ajouter = new JButton("ajouter");
JButton supprimer = new JButton("supprimer");
JButton rechercher = new JButton("rechercher");
JButton sauvegarder = new JButton("sauvegarder");
JLabel nomout = new JLabel("ericbouche");
JLabel urlout = new JLabel("http://2037.fr");
JTextField nomin = new JTextField(10);
JTextField urlin = new JTextField(25);
JPanel zonebouton = new JPanel();
JPanel zoneout = new JPanel();
JPanel zonein = new JPanel();
JPanel Jp = new JPanel();
Jp.setLayout(new BorderLayout(50,50));
// ajout du bouton dans la zone jlabel
zonebouton.add(ajouter);
zonebouton.add(supprimer);
zonebouton.add(rechercher);
zonebouton.add(sauvegarder);
zoneout.add(nomout);
zoneout.add(urlout);
zonein.add(new JLabel("Nom : "));
zonein.add(nomin);
zonein.add(new JLabel("Adresse : "));
zonein.add(urlin);
urlin.setText("http://");
// audition des évenements
// ajouter.addActionListener(this);
// supprimer.addActionListener(this);
// rechercher.addActionListener(this);
// sauvegarder.addActionListener(this);
// ajout du jpanel mazone à la jframe
add(zonebouton, BorderLayout.NORTH);
add(zoneout, BorderLayout.CENTER);
add(zonein, BorderLayout.SOUTH);
}
} |
Partager