R
R
redq2021-05-07 18:33:15
Java
redq, 2021-05-07 18:33:15

Java GUI why does the window appear in the top left corner on Linux Kubuntu?

I create a window using JFrame, set the window size and position, but every time the program starts, the window appears in the upper left corner, as in the screenshot. Sometimes, but very rarely, everything appears as it should. What could be the problem and how to fix it? Everything works on Windows.

60955cd877b39110436008.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivan19631224, 2021-05-07
@redq

Try putting it setVisible()at the end.
Also try putting everything inside SwingUtilities.invokeAndWait(), SwingUtilities.invokeLater(). In theory, all methods that update the GUI should be called like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question