April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
JTabbedPane
nJTabbedPane permiti que diversos componentes, em geral JPanel, compartilhem um mesmo espaço.
nJTabbedPane tP = new JTabbedPane(); JComponent p1, p2, p3, p4;
nImageIcon icon = createImageIcon("images/middle.gif");
np1 = makeTextPanel("Panel #1");
ntP.addTab(“One", icon, p1, "Does nothing");
ntP.setMnemonicAt(0, KeyEvent.VK_1);
np2 = makeTextPanel("Panel #2");
ntP.addTab("Two", icon, p2, "Does twice as much nothing");
ntP.setMnemonicAt(1, KeyEvent.VK_2);
np3 = makeTextPanel("Panel #3");
ntP.addTab("Three", icon, p3,“nothing"); tP.setMnemonicAt(2, KeyEvent.VK_3);
np4 = makeTextPanel( "Panel #4 (has a preferred size of 410 x 50).");
np4.setPreferredSize(new Dimension(410, 50));
ntP.addTab(“Four", icon, p4, "Does nothing at all");
ntP.setMnemonicAt(3, KeyEvent.VK_4);
n
n                    TabbedPaneDemo
n