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
| import java.awt.Color;
import java.awt.SystemColor;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class login {
public static void main(String[] args) {
JFrame frame = new JFrame("login");
frame.getContentPane().setBackground(SystemColor.window);
JLabel label = new JLabel("");
label.setIcon(new ImageIcon("E:\\d\u00E9veloppement\\D\u00E9v_eclipse\\hopital\\image\\page--2.png"));
label.setBounds(0, -25, 950, 700);
frame.getContentPane().add(label);
frame.setSize(900, 700);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
placeComponents(frame);
JMenuBar menuBar = new JMenuBar();
menuBar.setBackground(SystemColor.control);
frame.setJMenuBar(menuBar);
JMenu mnLotfi = new JMenu("Fichier");
mnLotfi.setBackground(Color.WHITE);
menuBar.add(mnLotfi);
JMenuItem mntmHello = new JMenuItem("hello");
mnLotfi.add(mntmHello);
JMenu mnNewMenu = new JMenu("Outil");
mnNewMenu.setBackground(Color.WHITE);
menuBar.add(mnNewMenu);
frame.setVisible(true);
}
private static void placeComponents(JFrame frame) {
frame.getContentPane().setLayout(null);
JTextField userText = new JTextField(20);
userText.setBackground(Color.WHITE);
userText.setBounds(36, 324, 180, 30);
frame.getContentPane().add(userText);
JPasswordField passwordText = new JPasswordField(20);
passwordText.setBounds(36, 390, 180, 30);
frame.getContentPane().add(passwordText);
JButton loginButton = new JButton("");
loginButton.setIcon(new ImageIcon("E:\\d\u00E9veloppement\\D\u00E9v_eclipse\\hopital\\image\\connection.png"));
loginButton.setBounds(51, 441, 152, 37);
frame.getContentPane().add(loginButton);
JButton registerButton = new JButton("");
registerButton.setIcon(new ImageIcon("E:\\d\u00E9veloppement\\D\u00E9v_eclipse\\hopital\\image\\enregistrer.png"));
registerButton.setBounds(51, 489, 146, 41);
frame.getContentPane().add(registerButton);
}
} |
Partager