File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

flicker in my program

 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Tim LeMaster
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic