This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Program is not compiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Program is not compiles" Watch "Program is not compiles" New topic
Author

Program is not compiles

Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
Hello
I'm begiiner of Java Programing language. I wrote some small Java program(JDK 1.3 is install and I'm using Jcreator(as text editor and compiler) ). But it gave me some errors:
// HelloWorld.java
import browser.Applet;
import awt.Graphics;
class HelloWorld extends Applet{
public void init(){
resize(600,300);
}
public void paint (Graphics g)
{
g.drawString("Hello World!", 50 , 100);
}
}
Errors:
--------------------Configuration: JDK version 1.3.0_02 <Default>------------------------------------------------
C:\Documents and Settings\Administrator\Desktop\HelloWorld.java:1: cannot resolve symbol
symbol : class Applet
location: package browser
import browser.Applet;
^
C:\Documents and Settings\Administrator\Desktop\HelloWorld.java:2: cannot resolve symbol
symbol : class Graphics
location: package awt
import awt.Graphics;
^
C:\Documents and Settings\Administrator\Desktop\HelloWorld.java:3: cannot resolve symbol
symbol : class Applet
location: class HelloWorld
class HelloWorld extends Applet{
^
C:\Documents and Settings\Administrator\Desktop\HelloWorld.java:7: cannot resolve symbol
symbol : class Graphics
location: class HelloWorld
public void paint (Graphics g)
^
C:\Documents and Settings\Administrator\Desktop\HelloWorld.java:5: cannot resolve symbol
symbol : method resize (int,int)
location: class HelloWorld
resize(600,300);
^
5 errors
Process completed.
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
i am not familiar with browser package maybe you got this wrong it should be
import java.applet.*; or import java.applet.Applet;
and
import java.awt.*;


Val SCJP <BR>going for SCJD
manish paliwal
Greenhorn

Joined: May 18, 2001
Posts: 16
Hello,
First solution:- you should import java.awt.graphics; & java.applet.Applet; instead of awt.graphics; & applet.Applet
Second solution:- if you calling resize() method than it must be declared in your java program.
HOPE YOUR PROBLEM WILL BE SOLVED
------------------
manish paliwal(or just mann )


manish paliwal(or just mann )
manish paliwal
Greenhorn

Joined: May 18, 2001
Posts: 16
Hello,
First solution:- you should import java.awt.graphics; & java.applet.Applet; instead of awt.graphics; & applet.Applet
Second solution:- if you calling resize() method than it must be declared in your java program.
HOPE YOUR PROBLEM WILL BE SOLVED
------------------
manish paliwal(or just mann )
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
i don't think it has to be declared i think it's inheirited when he extended Applet but i don't remember the api.
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Val, you are correct resize() is inherited from the Applet class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Program is not compiles
 
Similar Threads
Button Problems
VisualMobileSystem
How can I get my HelloWorld Servlet to Run?
Compile problems with drawing applet
error with compiling servlet