Link to home
Start Free TrialLog in
Avatar of mmouer
mmouer

asked on

Returning to main panel.

Problem:

JFrame contains mainPanel with method A that creates onePanel to display a table containg data from a DB.

When I'm done I want to return to the mainPanel so I can select a new method to call a different panel.

When I'm done with onePanel how do I get back to the mainPanel?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Sounds like you'd be well of with a CardLayout

http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html
Avatar of mmouer
mmouer

ASKER

Why would a Card layout help?

I want each panel to be displayed as it is selected and then return to the main panel, which contains several buttons, for the next selection.
Perhaps use a JDialog that pops up to display your table
Avatar of mmouer

ASKER

Am I going about this the wrong way?
In other languages I've used when you branch to another form you return to the next instruction when you've completed using that new form.
Java continues before you return from the new form.
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)