简体   繁体   中英

Sporadic GUI freeze on the (java) application start

we have a strange problem with our GUI after changing to Java 1.7.

Sometimes if the user starts our Application it seems to be freezed, but probably there is just no repaint, because if user tries for example to scroll, changes the window and comes back to application the scroll changes are visible.

And the problem will be solved if the users change to fullscreen.

I tried to search for this problem, but the only thing most related to it was an unanswered question here:

http://www.java-forums.org/awt-swing/31107-intermittent-freeze-javawebstart-swing-app.html

May be anyone of you had the problem and know the solution?

The migration to Java 7 may have exposed a latent problem in the original code. Here are some things to look at:

  • Some APIs, especially among the text components listed here , are no longer marked thread safe in Java 7.

  • You can search for EDT violations using one of the approaches cited here .

  • Resizing the enclosing Window generates an automatic repaint() ; if your updates are otherwise correctly synchronized, you can sequence your own repaint() using invokeLater() .

  • Verify that setVisible() is last in your initialization, after pack() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM