Sorry about the empty post before.

I am also using that book (O'Reilly's Learning Java), and the code from the
accompanying cd compiles and runs. I find that book a little bit fast moving,
right from the start. Ivor Horton's book from Wrox takes about 20-30 pages
to explain Swing and making windows and JFrames and the like, (vs about 3
pages in the beginning of the OReilly book) which I found very helpful. He
starts with a basic JFrame window, just a title bar with working close box:


import javax.swing.*;
public class TryWindow
{
static JFrame aWindow = new JFrame("This is the window title");

public static void main( String [] args)
{
aWindow.setBounds(50,100,400,150); //position and size
aWindow.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
aWindow.setVisible(true);
}//end main

}//end TryWindow



Construct the JFrame, set the size, make it close, and make it visible.
Hope this helps.

John