Advertisement
Guest User

JFrame Problem

a guest
Mar 26th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class dashboard extends JFrame {
  5.    
  6.     public static void main(String[] agrs)
  7.     {  
  8.         new dashboard();
  9.     }
  10.    
  11.     public dashboard()
  12.     {
  13.         this.setSize(500,500);
  14.         this.setVisible(true);
  15.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  16.         this.setTitle("OEMGE APP");
  17.         this.setLocationRelativeTo(null);
  18.         this.setResizable(false);
  19.        
  20.         JPanel p = new JPanel(new FlowLayout());
  21.         JTextField welcomeMSG = new JTextField("Hello There");
  22.         JButton randomButton = new JButton("Click Me :D");
  23.         p.add(welcomeMSG);
  24.         p.add(randomButton);
  25.         this.add(p);
  26.     }
  27.    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement