Are the Java GUIs always slow to upgrade or is it just me?

I was just starting to create my first Java GUI application, and I decided to use the NetBeans IDE to do this. I think that his work is still beautiful, except for one problem; This is a slow update to the contents of the window.

Even in very simple windows with several controls, I find that when - for example, closing or resizing the window, I get the normal border of the window, but the inside is fully visible for a second.

This is not the biggest deal in the world, I just find it slightly annoying.

EDIT: I tried HelloWorldSwing from the official Java tutorial, but I have the same problem, only now, when changing the transparency size, the new window area is black until the content is updated.

+4
source share
3 answers

You must ensure that all GUI updates are performed in Thread Dispatch Thread, and that any other lengthy tasks are performed in workflows. If you have long run tasks running in EDT, your GUI will seem sluggish. Take a look at this tutorial for Swing Threading concepts .

+2
source

In the absence of any technical problems with your application, these may simply be JVM warm-up effects. Are updates updated if you resize the window several times?

+1
source

This could be a Java2D hardware testing issue. Is your driver for your 3D graphics card fully updated?

+1
source

Source: https://habr.com/ru/post/1310188/


All Articles