I've got a
You can keep the CardLayout, but you need to do the following:
1. set the layout of your JDialog to BorderLayout, and add a new JPanel (contentPanel) to the JDialog
2. now set this contentPanel layout to be CardLayout
3. add your other panels to the cardlayout as required.
4. Also make sure off the layouts you use on each of the panels you're adding to the CardLayout. By default JPanel uses FlowLayout, I think, and this is not ideal for a JTable. So you might need to play around with the layout of the panel containing the table as well; try out BoxLayout or BorderLayout for that as well.