I am working on a Java desktop application, and sometimes my jmenubar shows up, sometimes it doesn't. When it doesn't the entire program freezes and I have to kill it.
I am creating it and setting it in my constructor for the frame.
The code:
// Load any settings we might have made from last time.
loadSettings();
menuBar = createMenuBar();
setJMenuBar(menuBar);
// re-evaluate and re-layout things, since they've been changed.
validate();
addWindowListener(this);
As you can see in my code, I added a validate() call, hoping that would help. It does, actually, but the problem still happens from time to time.
Thanks in advance for your help!