javax.swing.JTabbedPane.getComponent()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中javax.swing.JTabbedPane.getComponent()方法的一些代码示例,展示了JTabbedPane.getComponent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getComponent()方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getComponent

JTabbedPane.getComponent介绍

暂无

代码示例

代码示例来源:origin: com.akiban/akiban-persistit

AbstractInspector getCurrentInspector() {
  final AbstractInspector inspector = _selectedTab == -1 ? null : (AbstractInspector) _tabbedPane
      .getComponent(_selectedTab);
  return inspector;
}

代码示例来源:origin: threerings/narya

@Override
public void removeNotify ()
{
  super.removeNotify();
  // when we're hidden, we want to clear out our subscriptions
  int ccount = _oeditors.getComponentCount();
  for (int ii = 0; ii < ccount; ii++) {
    Component comp = _oeditors.getComponent(ii);
    if (comp instanceof JScrollPane) {
      JScrollPane scrolly = (JScrollPane)comp;
      ObjectEditorPanel opanel = (ObjectEditorPanel)scrolly.getViewport().getView();
      opanel.cleanup();
    }
  }
  _oeditors.removeAll();
}

代码示例来源:origin: org.boofcv/boofcv-swing

private void removeProcessTab(ActiveProcess process, boolean autoClose ) {
  //interval removed listener is called after element is removed, so the reference
  //can't be retrieved. we call removeProcessTab() here for that reason.
  int index = -1;
  //lookup tab by process, assume one tab per process
  for (int i = 0; i < outputPanel.getComponents().length; i++) {
    ProcessTabPanel component = (ProcessTabPanel) outputPanel.getComponent(i);
    if (component.getProcessId() == process.getId()) {
      if( autoClose && !checkRemoveOnDeath.isSelected() ) {
        processList.repaint();
        return;
      }
      index = i;
    }
  }
  if (index == -1)
    return;
  outputPanel.remove(index);
  listModel.removeElement(process);
  processList.invalidate();
}

代码示例来源:origin: locationtech/jts

private void updateStatsPanelIfVisible()
{
 int index = inputTabbedPane.getSelectedIndex();
 if (index < 0) return;
 if (inputTabbedPane.getComponent(index) == statsPanel) {
  statsPanel.refresh();         
 }   
}

代码示例来源:origin: com.akiban/akiban-persistit

private void handleTabChanged() {
  final int newTab = _tabbedPane.getSelectedIndex();
  if (newTab == _selectedTab)
    return;
  _selectedTab = newTab;
  final AbstractInspector inspector = newTab == -1 ? null : (AbstractInspector) _tabbedPane.getComponent(newTab);
  if (inspector != null) {
    inspector.refreshed();
  }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = CHILD_JSDOC, params = {"index"})
@Override
public JComponent child(int aIndex) {
  return (JComponent) super.getComponent(aIndex);
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void stateChanged(ChangeEvent evt) {
    // Get current tab
    final JTabbedPane pane = (JTabbedPane) evt.getSource();
    final int c = pane.getSelectedIndex();
    if (c >= 0) {
      final boolean[] b = new boolean[5];
      b[0] = ((AbstractPanel) pane.getComponent(c))
      .isStartedEnabled();
      b[1] = ((AbstractPanel) pane.getComponent(c))
      .isStoppedEnabled();
      b[2] = ((AbstractPanel) pane.getComponent(c))
      .isPauseEnabled();
      b[3] = ((AbstractPanel) pane.getComponent(c))
      .isAddedEnabled();
      b[4] = ((AbstractPanel) pane.getComponent(c))
      .isRemovedEnabled();
      // Set the toolbar/menubar options which are enabled
      tb.setEnabledPanelOptions(b);
      mb.setEnabledPanelOptions(b);
    }
  }
});

代码示例来源:origin: nativelibs4java/JNAerator

private static void setTabTitle(JTabbedPane tabs, Component c, String string) {
  for (int i = tabs.getTabCount(); i-- != 0;) {
    Component tc = tabs.getComponent(i);//tabs.getTabComponentAt(i); 
    if (tc == c) {
      tabs.setTitleAt(i, string);
      return;
    }
  }
}

代码示例来源:origin: com.nativelibs4java/jnaerator

private static void setTabTitle(JTabbedPane tabs, Component c, String string) {
  for (int i = tabs.getTabCount(); i-- != 0;) {
    Component tc = tabs.getComponent(i);//tabs.getTabComponentAt(i); 
    if (tc == c) {
      tabs.setTitleAt(i, string);
      return;
    }
  }
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

/**
 * <p>
 * If a tab by the name specified, is open will return true.
 * </p>
 * 
 * @param name
 *            The name of the tab, e.g. " Fuzzing ", " Payloads ", ...
 * @return True if tab with that name is open
 * 
 * @author subere@uncon.org
 * @version 1.3
 * @since 1.2
 */
private boolean isTabOpen(String name) {
  for (int i = 0; i < tp.getTabCount(); i++) {
    if (name.equals((((AbstractPanel) tp.getComponent(i)).getName()))) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.codehaus.mevenide/lifecycle-build-plan

public void propertyChange(PropertyChangeEvent evt) {
    synchronized (BuildPlanTopComponent.class) {
      JTabbedPane pane = (JTabbedPane) evt.getSource();
      int sel = pane.getSelectedIndex();
      pane.removeTabAt(sel);
      if (pane.getTabCount() == 1) {
        BuildPlanViewUI bpvui = (BuildPlanViewUI) pane.getComponent(0);
                pane.removeAll();
        removeAll();
        addView(bpvui);
      }
    }
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent e) {
    final int c = getFrame().getTp().getSelectedIndex();
    final AbstractPanel p = (AbstractPanel) getFrame().getTp()
    .getComponent(c);
    p.stop();
  }
});

代码示例来源:origin: com.akiban/akiban-persistit

private void handleTabChanged() {
  final int oldTab = _selectedTab;
  final int newTab = _tabbedPane.getSelectedIndex();
  if (oldTab == newTab)
    return;
  _selectedTab = newTab;
  final AdminPanel oldPanel = oldTab == -1 ? null : (AdminPanel) _tabbedPane.getComponent(oldTab);
  final AdminPanel newPanel = newTab == -1 ? null : (AdminPanel) _tabbedPane.getComponent(newTab);
  if (oldPanel != null) {
    oldPanel.setIsShowing(false);
    changeMenuMap(oldPanel.getMenuMap(), false);
  }
  if (newPanel != null) {
    newPanel.setIsShowing(true);
    changeMenuMap(newPanel.getMenuMap(), true);
    scheduleRefresh(-1);
  }
  newPanel.setDefaultButton();
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent){
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (!mFrameWindow.getPanelFuzzing().isStopped()) {
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp().getComponent(c);
        p.stop();
        new SyncDatabaseDialog(mFrameWindow);
      }
    } else {
      new SyncDatabaseDialog(mFrameWindow);
    }
    
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent){
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (!mFrameWindow.getPanelFuzzing().isStopped()) {
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp().getComponent(c);
        p.stop();
        new OpenDatabaseDialog(mFrameWindow);
      }
    } else {
      new OpenDatabaseDialog(mFrameWindow);
    }
    
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent) {
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (mFrameWindow.getPanelFuzzing().isStopped()) {
      new OpenSession(mFrameWindow);
    } else {
      
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp()
        .getComponent(c);
        p.stop();
        new OpenSession(mFrameWindow);
      }
    }
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent) {
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (!mFrameWindow.getPanelFuzzing().isStopped()) {
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp()
        .getComponent(c);
        p.stop();
        new SaveAsSession(mFrameWindow);
      }
    } else {
      new SaveAsSession(mFrameWindow);
    }
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent) {
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (!mFrameWindow.getPanelFuzzing().isStopped()) {
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp()
        .getComponent(c);
        p.stop();
        new OpenLocationDialog(mFrameWindow);
      }
    } else {
      new OpenLocationDialog(mFrameWindow);
    }
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(ActionEvent aEvent) {
    mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
    mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
    if (mFrameWindow.getPanelFuzzing().isStopped()) {
      mFrameWindow.setCloseFile();
      mFrameWindow.setTitle("Untitled");
    } else {
      
      final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
          "Fuzzing Session Running. Stop Fuzzing?",
          " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
      if (choice == JOptionPane.YES_OPTION) {
        final int c = mFrameWindow.getTp().getSelectedIndex();
        final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp()
        .getComponent(c);
        p.stop();
        mFrameWindow.setCloseFile();
        mFrameWindow.setTitle("Untitled");
      }
    }
  }
});

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

public void actionPerformed(final ActionEvent aEvent) {
  mainMenuBar.setSelectedPanelCheckBox(JBroFuzzWindow.ID_PANEL_FUZZING);
  mFrameWindow.setTabShow(JBroFuzzWindow.ID_PANEL_FUZZING);
  if (!mFrameWindow.getPanelFuzzing().isStopped()) {
    final int choice = JOptionPane.showConfirmDialog(mFrameWindow,
        "Fuzzing Session Running. Stop Fuzzing?",
        " JBroFuzz - Stop ", JOptionPane.YES_NO_OPTION);
    if (choice == JOptionPane.YES_OPTION) {
      final int c = mFrameWindow.getTp().getSelectedIndex();
      final AbstractPanel p = (AbstractPanel) mFrameWindow.getTp()
      .getComponent(c);
      p.stop();
      mFrameWindow.getPanelFuzzing().getFuzzersPanel().clearFuzzersTable();
    }
  } else {
    mFrameWindow.getPanelFuzzing().getFuzzersPanel().clearFuzzersTable();
  }
}

相关文章

JTabbedPane类方法