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
posted
0
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
posted
0
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
posted
0
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
posted
0
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
posted
0
Val, you are correct resize() is inherited from the Applet class.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.