• Post Reply Bookmark Topic Watch Topic
  • New Topic

mousePressed and responding to it

 
Rene Ott
Greenhorn
Posts: 8
Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I create and event and I respond it with method mousePressed() then what is difference between these two:





Could anyone explain me, what is happening in the second code
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Well, the difference is that one example repaints the source always, and the other only if it's one specific panel. I think you can figure out which is which.
 
Rene Ott
Greenhorn
Posts: 8
Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example, if I have Applet with two panels, then the second code repaints that panel where the click was made. Am I right?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Am I right?

what happened when you tried it?
 
Rene Ott
Greenhorn
Posts: 8
Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't have chance before to try out. That's why the question was before experiment. But yes, I was right. Thanks for help ;)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!