Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //code for ShowWindow class
- //goes in main
- final int WINDOW_WIDTH = 350;
- // Window width in pixels 13
- final int WINDOW_HEIGHT = 250;
- // Window height in pixels 14
- // Create a window.
- JFrame window = new JFrame();
- // Set the title.
- window.setTitle("A Simple Window");
- // Set the size of the window.
- window.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
- // Specify what happens when the close button is clicked.
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- // Display the window.
- window.setVisible(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement