TestTabbedPane.java
Select all
/* TestTabbedPane.java CIS 260 2/22/2006 David Klick Demonstration of a tabbed interface using JTabbedPane. */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class TestTabbedPane extends JFrame { JTabbedPane tpane; public static void main(String[] args) { TestTabbedPane app = new TestTabbedPane("Tabbed Pane Test"); } TestTabbedPane() { this(""); } TestTabbedPane(String title) { super(title); tpane = new JTabbedPane(JTabbedPane.TOP); tpane.addChangeListener(new MyChangeListener()); String[] tabs = { "Pets", "Phone", "Garden", "Computer", "Attack", "Bag" }; String[] files = { "pets.jpg", "phoneCat.jpg", "gardenCat.jpg", "computerCat.jpg", "attackCat.jpg", "trouble_in_bag2.jpg" }; for (int i=0; i