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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
| import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* <p>Titre : </p>
* <p>Description : </p>
* <p>Copyright : Copyright (c) 2009</p>
* <p>Société : </p>
* @author non attribué
* @version 1.0
*/
public class Cadre6 extends JFrame {
JPanel contentPane;
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
JButton jButton7 = new JButton();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
ImageIcon image;
ImageIcon bus;
ImageIcon col;
JTextField jTextField1 = new JTextField();
JPasswordField jPasswordField1 = new JPasswordField();
JButton jButton8 = new JButton();
JButton jButton9 = new JButton();
//Construire le cadre
public Cadre6() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Initialiser le composant
private void jbInit() throws Exception {
image = new ImageIcon(getClass().getResource("logo.jpg"));
bus = new ImageIcon(getClass().getResource("bus.jpg"));
col = new ImageIcon(getClass().getResource("col.jpg"));
setIconImage(Toolkit.getDefaultToolkit().createImage(Cadre6.class.getResource("gogo.jpg")));
contentPane = (JPanel) this.getContentPane();
jLabel1.setText("");
jLabel1.setBounds(new Rectangle(-1, 1, 743, 99));
contentPane.setLayout(null);
this.setSize(new Dimension(748, 503));
this.setTitle("");
jLabel1.setIcon(image );
jButton1.setBounds(new Rectangle(44, 110, 54, 46));
jButton1.setBackground(Color.white);
jButton1.setIcon(bus);
jButton1.setText("");
jButton2.setBounds(new Rectangle(132, 110, 54, 46));
jButton2.setText("");
jButton2.setIcon(col);
jButton2.setBackground(Color.white);
jButton3.setBounds(new Rectangle(221, 109, 77, 46));
jButton3.setText("jButton3");
jButton4.setBounds(new Rectangle(318, 109, 77, 46));
jButton4.setText("jButton4");
jButton5.setBounds(new Rectangle(411, 110, 77, 46));
jButton5.setText("jButton5");
jButton6.setBounds(new Rectangle(504, 107, 75, 48));
jButton6.setText("jButton6");
jButton7.setBounds(new Rectangle(596, 107, 77, 49));
jButton7.setText("jButton7");
jLabel2.setFont(new java.awt.Font("SansSerif", 1, 14));
jLabel2.setText("Login :");
jLabel2.setBounds(new Rectangle(115, 206, 132, 44));
jLabel3.setFont(new java.awt.Font("SansSerif", 1, 14));
jLabel3.setText("Mot de passe :");
jLabel3.setBounds(new Rectangle(115, 272, 150, 43));
jTextField1.setText("");
jTextField1.setBounds(new Rectangle(339, 215, 187, 33));
jPasswordField1.setText("");
jPasswordField1.setBounds(new Rectangle(339, 267, 188, 33));
jButton8.setBounds(new Rectangle(176, 376, 137, 39));
jButton8.setFont(new java.awt.Font("SansSerif", 1, 14));
jButton8.setText("s\'inscrire");
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton8_actionPerformed(e);
}
});
jButton9.setBounds(new Rectangle(417, 377, 161, 39));
jButton9.setFont(new java.awt.Font("SansSerif", 1, 14));
jButton9.setText("valider");
contentPane.add(jButton1, null);
contentPane.add(jButton2, null);
contentPane.add(jButton3, null);
contentPane.add(jButton4, null);
contentPane.add(jButton5, null);
contentPane.add(jButton6, null);
contentPane.add(jButton7, null);
contentPane.add(jLabel1, null);
contentPane.add(jLabel2, null);
contentPane.add(jLabel3, null);
contentPane.add(jTextField1, null);
contentPane.add(jPasswordField1, null);
contentPane.add(jButton8, null);
contentPane.add(jButton9, null);
}
//Remplacé, ainsi nous pouvons sortir quand la fenêtre est fermée
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void jButton8_actionPerformed(ActionEvent e) {
//jButton1_actionPerformed(e);
//consoleCancel();
}
public static void main(String[] args){
Cadre6 C=new Cadre6();
C.setVisible(true);
}
} |
Partager