Results 1 to 4 of 4
- 03-27-2011, 04:00 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Bug in repaint java2d object using mouseWheelListener
I am drawing basic java2d image like rectangle. And also implementing mouse wheel listener to zoom in and out the shape.
Inside the action listener i adding repaint(); it doesnt clear the previous object and it keep redrawing in the APPLET. is the way to clear the applet?
- 03-27-2011, 04:37 AM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Custom painting in a Swing application is done by overriding the paintComponent() method of a JPanel (and then you add the panel to the applet). You need to make sure you invoke super.paintComponent(g) as the first statement in your method so the background gets repainted.
Last edited by camickr; 03-27-2011 at 04:11 PM.
- 03-27-2011, 11:19 AM #3
Your code shows no attempt to utilize the valuable advice already given by camickr. Not the best way to get further help, that.
Also, post code in code tags -- [code]CODE[/code] will display asdbJava Code:CODE
- 05-05-2011, 05:33 PM #4
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
the very very very basics of java2d
By senca in forum New To JavaReplies: 1Last Post: 11-24-2010, 03:30 PM -
Java2D
By Alex j in forum Java 2DReplies: 1Last Post: 04-07-2009, 04:59 PM -
Ebook for java2D for beginners.
By hardiks21 in forum Java 2DReplies: 2Last Post: 02-08-2009, 12:04 PM -
n00b help with java2D api
By michcio in forum Java 2DReplies: 7Last Post: 10-30-2008, 06:18 PM -
Demonstrating the MouseWheelListener
By Java Tip in forum java.awtReplies: 0Last Post: 04-23-2008, 08:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks