I have a frame containing a JMenuBar. If the users clicks the "Logout" MenuItem, I would remove all the frame's content and initialize it with other content. The issue is that if I call
parent.getContentPane().removeAll();
LoginActivity l = new LoginActivity(parent);
l.init();
parent.validate();
the frame gets some other content but the JMenuBar from the previous "view" it's still here. How could I get rid of it?
frame.setJMenuBar(null); // this should do the job
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With