tabPane = new JTabbedPane(); tabPane.add(new JLabel("One", JLabel.CENTER), "First"); tabPane.add(new JLabel("Two", JLabel.CENTER), "Second");
JFrame f = new JFrame("Tab Demo"); f.getContentPane().add(new TabPaneDemo().tabPane); f.setSize(120, 100); f.setVisible(true);