Mouse listener

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 1,657
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 206
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Mouse listener

 
0
  #21
Nov 1st, 2008
http://java.sun.com/j2se/1.4.2/docs/...eListener.html

Thats the Javadoc for MouseListener. Now, you tell me, what method should your code go if you want something to happen when the user clicks the mouse?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 57
Reputation: complexcodes is an unknown quantity at this point 
Solved Threads: 1
complexcodes complexcodes is offline Offline
Junior Poster in Training

Re: Mouse listener

 
0
  #22
Nov 1st, 2008
I know the code goes in mouseClicked(MouseEvent e)
My question is what would my code be like in that method? any help, sir???
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,657
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 206
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Mouse listener

 
0
  #23
Nov 2nd, 2008
I'm really not sure how you would do that. You should look into the documentation for the various methods you've been using, such as the ones that you are currently using in your paint method. For example, what would happen if you set both the rectangle's length and width to 0 then called repaint? It seems like this would lead to a rectangle with 0 area, which would be painted as nothing on your screen. That probably isn't the best way to go about things, in fact - probably the worst way you could do it - but it will probably work. If you want a better solution, which I'd hope you do, then look into the methods you are using. They have documentation which tells you what happens based on the parameters.
Last edited by BestJewSinceJC; Nov 2nd, 2008 at 1:57 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2716 | Replies: 22
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC