// using JTabbedPane

JTabbedPane tabbedPane = new JTabbedPane();

ImageIcon icon = createImageIcon("images/tabdecoration.gif");

tabbedPane.addTab("Identification", icon, idPanel,
                  "Identification details" );

// hit alt-I key to get the 0th panel, i.e. idPanel
tabbedPane.setMnemonicAt( 0, KeyEvent.VK_I );

tabbedPane.addTab("Phone", icon, phonePanel,
                  "Home and WorK Phone numbers" );

tabbedPane.setMnemonicAt( 1, KeyEvent.VK_P );

// this effectively sets preferredSize for the tabbedPane as a whole.
webPanel.setPreferredSize( new Dimension( 410, 50 ) );

tabbedPane.addTab("Web", icon, webPanel,
                  "email and website info");

tabbedPane.setMnemonicAt( 2, KeyEvent.VK_W );