Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class Main extends JFrame {
- public Main() {
- JFrame f = new JFrame("MMORPG");
- JPanel p = new JPanel();
- JPanel p2 = new JPanel();
- p.setLayout(new FlowLayout());
- p2.setLayout(new FlowLayout());
- JLabel usernameLabel = new JLabel("Username: ");
- JTextField username = new JTextField(20);
- p.add(usernameLabel);
- p.add(username);
- f.add(p);
- JLabel passwordLabel = new JLabel("Password: ");
- JTextField password = new JTextField(20);
- p2.add(passwordLabel);
- p2.add(password);
- f.add(p2);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- f.setSize(800, 600);
- f.setVisible(true);
- f.setLocationRelativeTo(null);
- f.setResizable(false);
- }
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new Main();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement