Author
mousePressed and responding to it
Rene Ott
Greenhorn
Joined: Apr 20, 2012
Posts: 8
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
Joined: Oct 27, 2005
Posts: 19216
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.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Rene Ott
Greenhorn
Joined: Apr 20, 2012
Posts: 8
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
Joined: Jun 09, 2003
Posts: 4632
posted Apr 20, 2012 14:25:39
0
> Am I right?
what happened when you tried it?
Rene Ott
Greenhorn
Joined: Apr 20, 2012
Posts: 8
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 ;)
subject: mousePressed and responding to it