Answer the question
In order to leave comments, you need to log in
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.
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question