'symbol not found' class instansiation

I know posts like this are pretty common, but please humour me on this one, it's really annoying. (And before anyone asks the classpaths are fine ;-)

import java.awt.*;

import java.applet.*;

publicclass Gameextends Applet

{

publicvoid paint(Graphics g){}

publicvoid init()

{

Player player =new Player();

this.setLayout(new FlowLayout());

Panel panel =new Panel();

add(player.playerP);

}

}

[code]

[code]

import java.awt.*;

publicclass Playerextends Panel

{

publicstatic Panel playerP =new Panel();

/** Creates a new instance of */

public Player(){}

}

[1651 byte] By [Hard_Wireda] at [2007-11-26 22:28:03]
# 1
1) Paste in the exact, complete error message, and indicate clearly which line it's referring to.2) If you're getting that error, don't assume your classpath is fine.
jverda at 2007-7-10 11:31:00 > top of Java-index,Java Essentials,New To Java...
# 2
Ok, humour us. What's the error (not just 'symbol not found', but the actual error message)?
warnerjaa at 2007-7-10 11:31:00 > top of Java-index,Java Essentials,New To Java...
# 3
Hmmm, must be another case of an alien abduction. Posts a message, immediately gets a couple of requests for simply more needed information, and VANISHES.
warnerjaa at 2007-7-10 11:31:00 > top of Java-index,Java Essentials,New To Java...
# 4

You wanted errors:

init:

deps-jar:

Compiling 1 source file to /classes

Game.java:10: cannot find symbol

symbol : class Player

location: class Game

Player player = new Player();

Game.java:10: cannot find symbol

symbol : class Player

location: class Game

Player player = new Player();

2 errors

class Player compiles fine.

Hard_Wireda at 2007-7-10 11:31:00 > top of Java-index,Java Essentials,New To Java...
# 5

> You wanted errors:

Yesterday. Fortunately I was still watching the topic, but would have normally abandoned it.

Ok, so the error is all about your classpath being incorrect. I'm not sure what build tool you're using (ant?), but in its configuration you have not set up the proper classpath. So when the compiler tries to compile the Game class and sees a reference to a "Player" class, it doesn't know where it is. How does it find dependent classes? Via the classpath. You need to research and get a good grasp of what a classpath is all about.

warnerjaa at 2007-7-10 11:31:00 > top of Java-index,Java Essentials,New To Java...