public void help(String title, String path, boolean navigation) { for (int i = 0; i < tabbedPane.getTabCount(); i++) { if (!(tabbedPane.getComponentAt(i) instanceof Tab)) { if (tabbedPane.getTitleAt(i).equals(title) || tabbedPane.getTitleAt(i).startsWith(title + "-")) { tabbedPane.setSelectedIndex(i); return; } } } JComponent help; if (navigation) { help = new AdvancedHelpPanel(getClass().getResource(path), this); } else { help = new JScrollPane(new HelpPanel(getClass().getResource(path), this).getPane()); } tabbedPane.addTab(help, title, Icons.getIcon("help")); }
public void appendText(final String tabTitle, final String text) { for (int i = 0; i < tabbedPane.getTabCount(); i++) { if (tabbedPane.getTitleAt(i).equals(tabTitle)) { if (tabbedPane.getComponentAt(i) instanceof Tab) { Tab tab = (Tab) tabbedPane.getComponentAt(i); tab.append(text); } } } }