Advertisement
prprice16

example1

Feb 17th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. //code for ShowWindow class
  2. //goes in main
  3. final int WINDOW_WIDTH = 350;  
  4. // Window width in pixels 13        
  5. final int WINDOW_HEIGHT = 250;  
  6. // Window height in pixels 14
  7. // Create a window.
  8. JFrame window = new JFrame();
  9. // Set the title.
  10. window.setTitle("A Simple Window");
  11. // Set the size of the window.
  12. window.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
  13. // Specify what happens when the close button is clicked.
  14. window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  15. // Display the window.
  16. window.setVisible(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement