Advertisement
Guest User

Untitled

a guest
Sep 15th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. import java.awt.*;
  2.  
  3. import javax.swing.*;
  4.  
  5.  
  6. public class Main extends JFrame {
  7.     public Main() {
  8.         JFrame f = new JFrame("MMORPG");
  9.         JPanel p = new JPanel();
  10.         JPanel p2 = new JPanel();
  11.         p.setLayout(new FlowLayout());
  12.         p2.setLayout(new FlowLayout());
  13.  
  14.         JLabel usernameLabel = new JLabel("Username: ");
  15.         JTextField username = new JTextField(20);
  16.         p.add(usernameLabel);
  17.         p.add(username);
  18.         f.add(p);
  19.        
  20.         JLabel passwordLabel = new JLabel("Password: ");
  21.         JTextField password = new JTextField(20);
  22.         p2.add(passwordLabel);
  23.         p2.add(password);
  24.         f.add(p2);
  25.        
  26.         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  27.         f.setSize(800, 600);
  28.         f.setVisible(true);
  29.         f.setLocationRelativeTo(null);
  30.         f.setResizable(false);
  31.     }
  32.     /**
  33.      * @param args
  34.      */
  35.     public static void main(String[] args) {
  36.         // TODO Auto-generated method stub
  37.         new Main();
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement