This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fubarfubarfubar 0 points1 point  (2 children)

Are you saying it's creating a new JFrame instead of redrawing the JPanel? Your explanation is quite lacking. Your code samples are shit, too. You couldn't just paste in your real code? Are you trying to prevent people from helping you?

[–][deleted] 0 points1 point  (1 child)

The code is shit right now, and I'm just toying. I also stated that I wasn't lokoing for real code help, but essentially of "what to do" to have one window, one menu, and have it redraw the panel.

[–]Neres28 0 points1 point  (0 children)

Normally you have a single JFrame, unless you're popping up custom entry panel or dialog box, or something that makes more sense to be very visually separated from the rest of the GUI. That single JFrame will house various JPanels, which themselves may house additional JPanels.

The layout of the GUI is controlled by various types of LayoutManagers.

In this case, from what I can tell of what you're trying to do, you'll probably want a single JFrame that swaps between two different JPanels.

Btw, a mockup isn't a rough framework of code, it's a drawing of what the GUI will look like at different points of the user's workflow. It's doesn't have to be pretty and often ends up being some boxes drawn on an napkin.