• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot find symbol

 
trish kreiss
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm brand new to Java (as in day one) and I'm trying to get some of the basics down. I downloaded the latest Java SE development kit from SUN to my windows XP machine and am trying out some really simple things I found in a tutorial called java.about.com. I got the basic 'hello world' little program to compile and run. Now I am trying an applet but it seems I'm missing something really basic somewhere. When I compile with javac for every symbol I get 'cannot find symbol'.. symbol variable 'color' 'green' etc. I have the two imports that the tutorial says to include. What am I missing? Thanks, Trish

Here is the code:

//import the required Java Libraries
import java.applet.*;
import java.awt.*;

//The applet code
public class TrishApplet extends Applet {

public void paint(Graphics g) {

//draw a rectangle width=250, height=100
g.drawRect(0,0,250,100);

//set the color to green
g.setColor(Color,green);

//write the message to the web page
g.drawstring("this is my little green Java applet!",10,50);
}
}


 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
g.setColor(Color,green);

That should read
g.setColor(Color.green);
 
trish kreiss
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for quick response!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic