@Test public void testGetSelectedIndex() { HidableTabbedPane h; h = new HidableTabbedPane(); assertEquals(h.getSelectedIndex(), 0); JLabel one = new JLabel("One"); h.addTab("Tab Two", one); assertEquals(h.getSelectedIndex(), 0); JLabel two = new JLabel("Two"); h.addTab("Tab Two", two); assertEquals(h.getSelectedIndex(), 0); h.setSelectedIndex(1); assertEquals(h.getSelectedIndex(), 1); }
public int getSelectedIndex() { if (tabs.getTabCount() <= 1) { return 0; } else { return tabs.getSelectedIndex(); } }
HidableTabbedPane extends JPanel { public int getSelectedIndex() { if (tabs.getTabCount() <= 1) { return 0; } else { return tabs.getSelectedIndex(); } } }
HidableTabbedPane extends JPanel { public int getSelectedIndex() { if (tabs.getTabCount() <= 1) { return 0; } else { return tabs.getSelectedIndex(); } } HidableTabbedPane();  HidableTabbedPane(String firstTabTitle, Component firstComponent); }
HidableTabbedPane extends JPanel { public int getSelectedIndex() { if (tabs.getTabCount() <= 1) { return 0; } else { return tabs.getSelectedIndex(); } } HidableTabbedPane();  HidableTabbedPane(String firstTabTitle, Component firstComponent); int getTabCount(); int getSelectedIndex(); void setSelectedIndex(int index); Component getComponentAt(int index); Component getTabComponentAt(int index); void setComponentAt(int index, Component component); void setTabComponentAt(int index, Component component); boolean isTabsShown(); void addTab(String title, Component component); void removeTabAt(int index); void addChangeListener(ChangeListener listener); }
HidableTabbedPane extends JPanel { public int getSelectedIndex() { if (tabs.getTabCount() <= 1) { return 0; } else { return tabs.getSelectedIndex(); } } HidableTabbedPane();  HidableTabbedPane(String firstTabTitle, Component firstComponent); int getTabCount(); int getSelectedIndex(); void setSelectedIndex(int index); Component getComponentAt(int index); Component getTabComponentAt(int index); void setComponentAt(int index, Component component); void setTabComponentAt(int index, Component component); boolean isTabsShown(); void addTab(String title, Component component); void removeTabAt(int index); void addChangeListener(ChangeListener listener);  }