Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

counting the shapes  RSS feed

 
Mohamad Samy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following problem, a class called drawpanel that have three variables named counter1,2,3 to count the random generated shapes. I made also a class called MyLabel to return string of the counted shapes to be received in the main test class but I got an error when I created DrawPanel object to initialize the counters and I got can't find symbol error.
DrawPanel


and the test class

and the class returning the string of the counted shpes is

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which symbol isn't found? Post the entire error message.
 
Mohamad Samy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the second class declared at line 14 I have the message: can't find symbol panel.counter1, panel.counter2, panel.counter3
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's odd. If I change DrawPanel so that it doesn't reference the missing classes, everything compiles fine.

Try deleting all class files you have, and compiling everything from scratch.
 
Mohamad Samy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the graphics will work but I want to add a label containing the number of the random generated shapes at the south of the JFrame I created but still the same compilation error because of those three counters
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So did you try what I suggested? As I said, I can not reproduce the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!