import javax.swing.*;
public class HelloWorldSwing {
public static void main(String[] args) {
JFrame frame = new JFrame("HelloWorldSwing");
final JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
C:\java\HelloWorldSwing.java:2: Package javax.swing not found in import.
import javax.swing.*;
^
1 error
It's supose to display "Hello world" in a window but I don't seem to have the classes needed for Swing. I have JDK1.1.8 and I downloaded JDK 1.2.2 today to see if that world work but I got the same error. I dirrected my complier ( JCreator LE -
www.jcreator.com ) to both JDK 1.1.8 and JDK 1.2.2 directories.
Can anyone tell me what I have to download or what I have to do to fix this error.
Cheer's, BoB.