Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Hashtable<String, String> login(JFrame frame) {
- Hashtable<String, String> logininformation = new Hashtable<String, String>();
- JPanel panel = new JPanel(new BorderLayout(5, 5));
- JPanel label = new JPanel(new GridLayout(0, 1, 2, 2));
- label.add(new JLabel("E-Mail", SwingConstants.RIGHT));
- label.add(new JLabel("Password", SwingConstants.RIGHT));
- panel.add(label, BorderLayout.WEST);
- JPanel controls = new JPanel(new GridLayout(0, 1, 2, 2));
- JTextField username = new JTextField();
- controls.add(username);
- JPasswordField password = new JPasswordField();
- controls.add(password);
- panel.add(controls, BorderLayout.CENTER);
- JOptionPane.showMessageDialog(frame, panel, "login", JOptionPane.QUESTION_MESSAGE);
- logininformation.put("user", username.getText());
- logininformation.put("pass", new String(password.getPassword()));
- return logininformation;
- }
- JOptionPane.showConfirmDialog(
- frame, panel, "login", JOptionPane.OK_CANCEL_OPTION);
- jButton1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e){
- frameName.dispose();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement