int indexOf(String strThreadID) { int iMonitorCount = pnlThread.getComponentCount(); for (int iMonitorIndex = 0; iMonitorIndex < iMonitorCount; iMonitorIndex++) { PanelThreadMonitor mntTemp = ((PanelThreadMonitor) pnlThread.getComponentAt(iMonitorIndex)); if (mntTemp.mstrThreadID.equals(strThreadID)) return iMonitorIndex; } return -1; }
public void showPage(Editor anEditor) { for (int i = 0, n = tabbedPanel.getComponentCount(); i < n; i++) { if (tabbedPanel.getComponent(i) == anEditor.getComponent()) { // System.out.println ("Found editor "+anEditor.getName()+ " at i="+i); ejs.showPanel(defaultHeader); cardLayout.show(finalPanel, anEditor.getName()); tabbedPanel.setSelectedComponent(anEditor.getComponent()); return; } } }