473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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>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
Mar 9 '08 #1
3 2394
JosAH
11,448 Expert 8TB
The class is called JFrame not JFrama nor Jframe.

kind regards,

Jos
Mar 9 '08 #2
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, ...
Mar 9 '08 #3
sukatoa
539 512MB
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
Mar 9 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tuno | last post by:
I'm relatively new to Java Swing programming. I have a console application that processes text files and while doing so I want to suspend the execution when an error is encountered that requires...
5
Shinzon
by: Shinzon | last post by:
ok so far I have got: JFrame frame = new JFrame( "Matt's DVD's" ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); frame.setSize( 420, 170 ); // set frame size ...
5
Shinzon
by: Shinzon | last post by:
Ok so I have been working on this for a moment now and wondering how to add multiple jlabels to a jframe. the code looks like this: JLabel jl = new JLabel("DVD ID #= " + dvd); //Displays DVD...
3
by: coffeetime | last post by:
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...
2
by: zahit | last post by:
hi guys, my line doesn't appear on the frame. what's the problem? import java.util.*; import java.io.*; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.*; public class...
3
by: notaCons | last post by:
hello im quite newbies in Java Programing so any one can help me. i will be plz.... what am i trying here is try convert The JFrame to JApplet, but when i change the JFrame to JApplet 4 Error come...
6
by: gaya3 | last post by:
Hi, I need to make the frame invisible on action event in swings. I have the following code: public class sample_pgm extends JFrame{ public void sample() { JFrame jf =...
1
by: Gimzo | last post by:
Hi, I'm trying to create a button that opens a new window for setting up a whole crapload of constants for an analysis program. For this, I have a JButton. The actionPerformed-method activates...
1
by: sibusiso | last post by:
HI Can anyone help with the scenario where where you have to pass a certain data from one JFrame to another. For example, suppose you have a JFrame is your main window you disabled your Jmenu...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.