Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package edu.ucsb.cs56.W11.mrochin.lab06;
  2.  
  3. import javax. swing. *;
  4.  
  5. /** SimpleGui1 comes from Head First Java 2nd Edition p. 355.
  6. It illustrates a simple GUI with a Button that doesn't do anything yet.
  7.  
  8. @author Head First Java, 2nd Edition p. 355
  9. @author P. Conrad (who only typed it in and added the Javadoc comments)
  10. @version CS56, Spring 2011, UCSB
  11. */
  12.  
  13. public class SimpleGui1 {
  14.  
  15. /** main method to fire up a JFrame on the screen
  16. @param args not used
  17. */
  18.  
  19. public static void main (String[] args) {
  20. JFrame frame = new JFrame() ;
  21. JButton button = new JButton("click me") ;
  22. frame. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE) ;
  23. frame. getContentPane() . add(button) ;
  24. frame. setSize(300,300) ;
  25. frame. setVisible(true) ;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement