CardLayout « JTable « Java Swing Q&A





1. Swing - CardLayout and JTable    java-forums.org

public class ATMFrame extends JFrame { private static final long serialVersionUID = 1L; public ATMFrame() { this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.setSize(600, 400); this.setResizable(false); JPanel center = new JPanel(new CardLayout()); DisplayHistoryPanel history = new DisplayHistoryPanel(center); center.add(history, "history"); this.getContentPane().setLayout(new BorderLayout()); this.getContentPane().add(center, BorderLayout.CENTER); } public static void main(String[] args) { ATMFrame atmFrame = new ATMFrame(); atmFrame.setVisible(true); } }

2. Swing - CardLayout and JTable    forums.oracle.com