Have a Swing JMenuBar diasppear in the initial frame
posted 4 years ago
Let 's suppose that we have an application in which a JFrame appears initially which serves as an input form for the application user.
After the user has completed the form, he submits it and we open a new JFrame which has a JTable inside.
My question is if we can have a JMenuBar that will only be displayed in the second JFrame (after user has submitted on first frame).
I have tried to just create the JMenuBar and put it under the second frame but it is displayed in both frames (initial and JTable).
Please have in mind that once the new frame is opened, the initial one is still open since application assumes that user may choose to close the second frame and re-post things in the form.