JFrame error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coffeetime
    New Member
    • Mar 2008
    • 3

    JFrame error

    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>jav ac 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.setVisibl e( true );
    }
    }

    I hope you can help this beginner out ty already
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    The class is called JFrame not JFrama nor Jframe.

    kind regards,

    Jos

    Comment

    • coffeetime
      New Member
      • Mar 2008
      • 3

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

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

      probably another foolish error, ...

      Comment

      • sukatoa
        Contributor
        • Nov 2007
        • 539

        #4
        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>jav ac HelloJava.java
        HelloJava.java: 8: cannot find symbol
        symbol : method setsize(int,int )
        location: class javax.swing.JFr ame
        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

        Comment

        Working...