The Artima Developer Community
Sponsored Link

Java Answers Forum
MouseListener freezing up the repaint()

1 reply on 1 page. Most recent reply: Mar 22, 2004 2:55 AM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Marie Tessier

Posts: 2
Nickname: marie
Registered: Mar, 2004

MouseListener freezing up the repaint() Posted: Mar 19, 2004 5:27 PM
Reply to this message Reply
Advertisement
I am making a program with some animation in it, and there are places where I want a mouse click to call a function that contains several calls to repaint(). The trouble is, no screen painting happens until after the call that the mouse click caused finishes. I know the animation works because I can call it in the main body of my program (not event-driven) and I get wonderful moving graphics. Is there any trick with threading, synchronizing, or anything else I might not have thought of?


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: MouseListener freezing up the repaint() Posted: Mar 22, 2004 2:55 AM
Reply to this message Reply
You can try it out with thread.

Just at the mouseClick event invoke a thread to do the repaint.

And then do the remaining stuff

Flat View: This topic has 1 reply on 1 page
Topic: help me plz Previous Topic   Next Topic Topic: Inner Class Question

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use