| | |
Mouse listener
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2008
Posts: 1,657
Reputation:
Solved Threads: 206
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?
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?
•
•
Join Date: Sep 2008
Posts: 1,657
Reputation:
Solved Threads: 206
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.
![]() |
Similar Threads
- No action under action listener (ActionListener added!) (Java)
- Mouse Cursor Image (Java)
- JSpinner mouse event (Java)
- Adding mouse listener to a frame (Java)
- Java Visualizations with media (Game Development)
- Applet Help (Java)
- Is there a JOptionPane Listener? (Java)
- Java GUI--Dynamically Adding Buttons to a Menu (Java)
Other Threads in the Java Forum
- Previous Thread: can anyone find my mistake in TrainingZone.java
- Next Thread: Need help from java expert
Views: 2716 | Replies: 22
| Thread Tools | Search this Thread |
Tag cloud for Java
actuate android api apple applet application arguments array arrays automation balls binary bluetooth business c++ chat class classes client code codesnippet collections component database defaultmethod doctype dragging draw ebook eclipse error event exception file fractal froglogic game givemetehcodez graphics gui helpwithhomework hql html ide image input integer intersect invokingapacheantprogrammatically j2me java javaprojects jmf jni jpanel julia linux list loop looping map method methods mobile mysql netbeans newbie number numbers object oracle parameter php print problem program programming project recursion scanner screen server set size sms socket sort sql string sun swing swt tcp test threads time transfer tree udp windows






