I'm completely new to Java (just started today); i have some experience with C and HTML, but really nothing else. I recently purchased a book called "Learning Java", published by O'Reilly. The first application in the book is of course called "Hello Java", in which a frame is made and the text "Hello Java" is supposed to be printed. However, after typing in the code and trying to compile the program, I get the following error:
----------------------------------------------------------
HelloJava.java [5:1] cannot resolve symbol
symbol : constructor JFrame (java.lang.String)
location: class JFrame
JFrame frame = new JFrame("Hello Java!"
^
1 error
Errors compiling main.
-------------------------------------------------------
Again, since i'm a beginner, I have no idea what I've done wrong, or what this error means. If anybody has a clue as to what I have done wrong in my code, I would appreciate it greatly to know. The code is below, thanks everyone.
---------------------------------------------------
import javax.swing.*;
public class HelloJava
{
public static void main( String[] args ) {
JFrame frame = new JFrame("Hello Java!"
JLabel label = new JLabel("Hello Java!", JLabel.CENTER );
frame.getContentPane().add( label );
frame.setSize( 300, 300 );
frame.setVisible( true );
}
}
-----------------------------------------------------
-Dan
----------------------------------------------------------
HelloJava.java [5:1] cannot resolve symbol
symbol : constructor JFrame (java.lang.String)
location: class JFrame
JFrame frame = new JFrame("Hello Java!"
^
1 error
Errors compiling main.
-------------------------------------------------------
Again, since i'm a beginner, I have no idea what I've done wrong, or what this error means. If anybody has a clue as to what I have done wrong in my code, I would appreciate it greatly to know. The code is below, thanks everyone.
---------------------------------------------------
import javax.swing.*;
public class HelloJava
{
public static void main( String[] args ) {
JFrame frame = new JFrame("Hello Java!"
JLabel label = new JLabel("Hello Java!", JLabel.CENTER );
frame.getContentPane().add( label );
frame.setSize( 300, 300 );
frame.setVisible( true );
}
}
-----------------------------------------------------
-Dan