Reputation: 127
Everywhere people tell me to use this:
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
But the problem with that is that my JMenuBar
disappears(bizarre bug that happens to me) on and off, and only happens with that piece of code above.
I need a new way of maximizing my JFrame
window, one that wont mess up my JMenuBar
.
Upvotes: 0
Views: 136
Reputation: 324098
That is the proper way to maximize the frame.
If you get a random bug then maybe you are not executing the code on the Event Dispatch Thread. See Concurrency in Swing for more information.
If that doesn't help then post your SSCCE that demonstrates the problem, along with your OS and JDK version so people using the same platform can verify the problem (or not).
Upvotes: 4