![]() The problem with this is Swing is not thread safe and all updates to the UI should be made within the context of the Event Dispatching Thread. There are a number of ways to achieve this, depending what it is you hope to achieve, for example, you could simply use Thread.sleep to cause the thread to pause for a small amount of time between updates. For example, 25fps is about a 40 millisecond delay between updates, 60fps is about 16 milliseconds The likely problem is, that thread is running too fast for the UI, the UI is been shown well after the "ball" has left the visible area.įirst, you need to make sure that the updates are scheduled properly within the Event Dispatching Thread and secondly, that there is a short delay between updates.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |