Problem 30
A Boring Window
Type in the following code, and get it to compile. Run it, and see what it does.
import javax.swing.*;
public class BoringWindow extends JFrame {
public static void main(String[] args) {
JFrame f = new BoringWindow();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300, 200);
f.setVisible(true);
}
}
◄ 29: Using Swing for Input 31: A Frame with a Panel with Writing on It ►
Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.