aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes flicker in my program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "flicker in my program" Watch "flicker in my program" New topic
Author

flicker in my program

Adewale Adebusoye
Ranch Hand

Joined: Sep 28, 2005
Posts: 118
Hi..i have a program to draw recursive shapes. It draws ok but the drawing flickers and then disappears. I'll put my code below..please id really appreciate your help..thanks.



"Human beings can alter their lives by altering their state of mind" William James
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
You draw your triangle once and nothing ever redraws it.

Here is a quick and dirty version but it works -

Warning this code just WORKS its not good, it doesn't deal with resizing the window, and setting n above 10 causes serious performance problems on my machine.

Now where is my rap song





[ October 18, 2006: Message edited by: Tim LeMaster ]
[ October 18, 2006: Message edited by: Tim LeMaster ]
Adewale Adebusoye
Ranch Hand

Joined: Sep 28, 2005
Posts: 118
Thanks tim...but the draw method has to follow this format:

draw(Point p1, Point p2, Point P3, int n, JFrame w)

Since its for an assignment.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: flicker in my program
 
Similar Threads
DistanceFinder
help with JFrame program
Scrollbar not working
Intersection points not being determined accurately- java awt
Drawing/moving problem: how to define destination? (code included)