FileDocCategorySizeDatePackage
Tabbed.javaAPI DocExample3625Mon Apr 06 18:10:26 BST 1998c13.swing

Tabbed

public class Tabbed extends JPanel

Fields Summary
static Object[]
q
Constructors Summary
public Tabbed()

    setLayout(new BorderLayout());
    JTabbedPane tabbed = new JTabbedPane();
    for(int i = 0; i < q.length; i++)
      tabbed.addTab((String)q[i][0], 
        makePanel((Class)q[i][1]));
    add(tabbed, BorderLayout.CENTER);
    tabbed.setSelectedIndex(q.length/2);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    Show.inFrame(new Tabbed(),460,350);
  
static JPanelmakePanel(java.lang.Class c)

      
    String title = c.getName();
    title = title.substring(
      title.lastIndexOf('.") + 1);
    JPanel sp = null;
    try {
      sp = (JPanel)c.newInstance();
    } catch(Exception e) {
      System.out.println(e);
    }
    sp.setBorder(new TitledBorder(title));
    return sp;