Swing: unstabel window paint?
Good day everyone,
I have got a little problem with java/swing. When I create a window with JFrame, a JMenuBar and a JPanel the windows does not load well.
I only have got two windows which have both a JMenuBar and a JPanel. The main window has the problem that the JPanel does not load all the time and the about box (main window > JMenuBar > Help > About...) is sometimes too small, sometimes as big as the whole screen and sometimes the JMenuBar has space above it... The strange thing is that if you reopen the same window in the same session, it can look different and when you resize a window, you'll see it as it was meant to be..? I tried to repaint the components, but that did not help. So what did I do wrong?
In the attachment you'll find my source as well as the .class files.
I'm working on a ubuntu 10.4 system with
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
Ow, It is for school btw. Not really homework, but an extra project. I only have had a single Java starters course and this is a product of one day reading all kind of tutorials, one half a day typing and testing and three days trying to solve this error.