Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

repaint() not working.  RSS feed

 
Zeke Hans
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


My issue is with repaint(); . It said it is undefined for MouseMotionAdapter. have any thoughts?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zeus Macabre wrote:My issue is with repaint(); . It said it is undefined for MouseMotionAdapter. have any thoughts?

That is because on line 54 you call repaint(), as if it were a method in the MouseMotionAdapter, nor in the defacto class. You need to dereference an instance of something that has a repaint() method. So what do you want to repaint()?
 
Zeke Hans
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried that, it relieved the issue I was having, but it did not paint like I thought it would. I was trying to copy this :



I was trying to copy this from Deitel's Java. I don't see what is different between both codes. Why did I not need to declare repaint in the previous one, but not this one? Does not compute XD .And in all honesty, I dont see the point to using adapters. Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!