Advertisement
tcl1

[JAVA] Making a JFrame

Oct 30th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package something; //Package name replaces "something"
  2.  
  3. import javax.swing.JFrame; //So the JFrame can be resolved to a type
  4.  
  5. public class whatever { //Class name replaces "whatever"
  6.     public static void main(String [] args) {
  7.         JFrame frame = new JFrame("My JFrame");
  8.         frame.setVisible(true);
  9.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  10.         frame.setSize(400, 200); //Size can be adjusted
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement