daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Jul 21st, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Container;
  2. import java.awt.FlowLayout;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JLabel;
  9. import javax.swing.JTextField;
  10.  
  11.  
  12. public class RegisterListener implements ActionListener {
  13.    
  14.     static JTextField user;
  15.     static JTextField pass;
  16.    
  17.     RegisterListener(){
  18.            JFrame u = new JFrame("Register");
  19.            Container cpane = u.getContentPane();
  20.            cpane.setLayout(new FlowLayout());
  21.            JLabel lu = new JLabel("User:");
  22.            JTextField user= new JTextField("Your User");
  23.            JLabel e = new JLabel("Password:");
  24.            JTextField pass = new JTextField("Your password");
  25.            JButton send = new JButton("Register");
  26.            send.addActionListener(this);
  27.            cpane.add(lu);
  28.            cpane.add(user);
  29.            cpane.add(e);
  30.            cpane.add(pass);
  31.            cpane.add(send);
  32.            u.pack();
  33.            u.setVisible(true);
  34.     }
  35.    
  36.     public void Register(){
  37.         String u = RegisterListener.user.getText();
  38.         String p = RegisterListener.pass.getText();
  39.         ServerListener a = new ServerListener();
  40.         a.sendMessage("/register" +  " " + u + " " + p);
  41.         System.out.println("Debug: Register Send");
  42.     }
  43.    
  44.     public void actionPerformed (ActionEvent e)
  45.      {
  46.           System.out.println("Debug: Run Button Register");
  47.           Register();
  48.      }
  49.  
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top