Connecting Tech Pros Worldwide Help | Site Map

JFrame error

Newbie
 
Join Date: Mar 2008
Posts: 3
#1: Mar 9 '08
Hi,
I just decided to learn java, so I'm quite a noob.
I use the book learning java third edition.
have JDK 1.6
program in notepad.
I have made the simple HelloJava example, and now i wanted to make the one in the frame. but when i try to compile the .java file i get following error:

C:\Program Files\Java\JDK1.6.0_05\bin>javac HelloJava.java (the file is located in the bin map)
HelloJava.java:5: cannot find symbol
symbol : class JFrame
location: class HelloJava
Jframe frame = new JFrame ("Hello, Java!")
^
1 error

and it doesn't compile
here is the piece of code in de .java file

import javax.swing.*;

public class HelloJava {
public static void main(String[] args) {
JFrama frame = new JFrame( "Hello, Java!" );
JLabel label = new JLabel("Hello, Java!", JLabel.CENTER );
frame.add( label );
frame.setsize ( 300, 400 );
frame.setVisible( true );
}
}

I hope you can help this beginner out ty already
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Mar 9 '08

re: JFrame error


The class is called JFrame not JFrama nor Jframe.

kind regards,

Jos
Newbie
 
Join Date: Mar 2008
Posts: 3
#3: Mar 9 '08

re: JFrame error


ty vm,
I changed it but now I get an error for line 8:

C:\Program Files\Java\jdk1.6.0_05\bin>javac HelloJava.java
HelloJava.java:8: cannot find symbol
symbol : method setsize(int,int)
location: class javax.swing.JFrame
frame.setsize ( 300, 300 );
^
1 error

probably another foolish error, ...
Needs Regular Fix
 
Join Date: Nov 2007
Location: Cebu City, Philippines
Posts: 508
#4: Mar 10 '08

re: JFrame error


Quote:

Originally Posted by coffeetime

ty vm,
I changed it but now I get an error for line 8:

C:\Program Files\Java\jdk1.6.0_05\bin>javac HelloJava.java
HelloJava.java:8: cannot find symbol
symbol : method setsize(int,int)
location: class javax.swing.JFrame
frame.setsize ( 300, 300 );
^
1 error

probably another foolish error, ...

be careful of the syntax, uppercase and lowercase character.....
it is case sensitive....

you may read this....


sukatoa
Reply