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

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

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

JTabbedPane.getComponentAt介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

/**
 * Support the subscript operator for JTabbedPane.
 *
 * @param self  a JTabbedPane
 * @param index the index of the tab component to get
 * @return the component at the given index
 * @since 1.6.4
 */
public static Component getAt(JTabbedPane self, int index) {
  return self.getComponentAt(index);
}

代码示例来源:origin: groovy/groovy-core

public Component next() {
  return self.getComponentAt(index++);
}

代码示例来源:origin: deathmarine/Luyten

public void closeOpenTab(int index) {
  RTextScrollPane co = (RTextScrollPane) house.getComponentAt(index);
  RSyntaxTextArea pane = (RSyntaxTextArea) co.getViewport().getView();
  OpenFile open = null;
  for (OpenFile file : hmap)
    if (pane.equals(file.textArea))
      open = file;
  if (open != null && hmap.contains(open))
    hmap.remove(open);
  house.remove(co);
  if (open != null)
    open.close();
}

代码示例来源:origin: deathmarine/Luyten

public RSyntaxTextArea getCurrentTextArea() {
  RSyntaxTextArea currentTextArea = null;
  try {
    int pos = house.getSelectedIndex();
    System.out.println(pos);
    if (pos >= 0) {
      RTextScrollPane co = (RTextScrollPane) house.getComponentAt(pos);
      currentTextArea = (RSyntaxTextArea) co.getViewport().getView();
    }
  } catch (Exception e1) {
    Luyten.showExceptionDialog("Exception!", e1);
  }
  if (currentTextArea == null) {
    getLabel().setText("No open tab");
  }
  return currentTextArea;
}

代码示例来源:origin: stackoverflow.com

Component comp = getComponentAt(draggedTabIndex);
String title = getTitleAt(draggedTabIndex);
removeTabAt(draggedTabIndex);

代码示例来源:origin: cytoscape/application

/**
 * Returns the component at index.
 *
 * @return component at the given index.
 */
public Component getComponentAt(int index) {
  return tabbedPane.getComponentAt(index);
}

代码示例来源:origin: Audiveris/audiveris

/**
 * Report the stub displayed at provided index
 *
 * @param tabIndex the provided index (assumed to be a valid number) in stubsPane
 * @return the corresponding stub
 */
private SheetStub getStubAt (int tabIndex)
{
  JComponent component = (JComponent) stubsPane.getComponentAt(tabIndex);
  return stubsMap.get(component);
}

代码示例来源:origin: chatty/chatty

public Collection<Component> getAllComponents() {
  List<Component> result = new ArrayList<>();
  if (firstComp != null) {
    result.add(firstComp);
  } else {
    for (int i = 0; i < getTabCount(); i++) {
      result.add(tabs.getComponentAt(i));
    }
  }
  return result;
}

代码示例来源:origin: net.java.abeille/abeille

/**
 * @return a collection of currently opened FormEditors
 */
public Collection getEditors() {
  LinkedList editors = new LinkedList();
  for (int index = 0; index < m_forms_tab.getTabCount(); index++) {
    FormEditor editor = (FormEditor) m_forms_tab.getComponentAt(index);
    editors.add(editor);
  }
  return editors;
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-swing-action

public int getTabIndex(final JTabbedPane container, JComponent comp) {
  if (container != null && comp != null) {
    for (int i = 0; i < container.getTabCount(); i++) {
      Component o = container.getComponentAt(i);
      if (o.equals(comp)) {
        return i;
      }
    }
  }
  return -1;
}

代码示例来源:origin: stackoverflow.com

public JTextArea getTextAreaFromTab(JTabbedPane p_tabbedPane, int p_tabIdx)
{
  Component cmp = p_tabbedPane.getComponentAt(p_tabIdx /*index of tab*/);
  JPanel pnl = (JPanel)cmp; //cast to JPanel
  Component cmp2 = pnl.getComponent(0);  //get first child component
  JTextArea textArea = (JTextArea)cmp2; //cast to JTextArea
  return textArea;
}

代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing

public void hierarchyChanged(HierarchyEvent e)
  {
    if(tpane.getComponentAt(tab).isShowing())
    {
      tpane.setIconAt(tab, null);
      tpane.getComponentAt(tab).removeHierarchyListener(this);
    }
  }
});

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void appendMessageToPanel(int panelIndex, String message, Color color)
{
 if (SHOW_GUI_MESSAGE_FRAME)
 {
   message = prependTimeToMessage(message);
   GUIMessagePanel gUIMessagePanel = (GUIMessagePanel) jTabbedPane.getComponentAt(panelIndex);
   gUIMessagePanel.appendMessage(message, color);
   if (!locked)
    jTabbedPane.setSelectedIndex(panelIndex);
   lastMessagePanel = panelIndex;
 }
}

代码示例来源:origin: org.orbisgis/orbisgis-view

/**
 * The user click on clear all button
 */
public void onClearAll() {
  for(int tabId=0;tabId<tabbedPane.getTabCount();tabId++) {
    Component tabComp = tabbedPane.getComponentAt(tabId);
    if(tabComp instanceof OutputPanel) {
      OutputPanel panel = (OutputPanel)tabComp;
      panel.onMenuClear();
    }            
  }            
}

代码示例来源:origin: net.java.abeille/abeille

/**
 * @return the editor whose main form is the given form. If the given form
 *         is not opened in its own editor, null is returned.
 */
public FormEditor getEditor(FormComponent form) {
  for (int index = 0; index < m_forms_tab.getTabCount(); index++) {
    FormEditor editor = (FormEditor) m_forms_tab.getComponentAt(index);
    if (editor.getForm() == form)
      return editor;
  }
  return null;
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Tracks all existing tab component.
 */
protected void trackExistingTabs() {
  // register listeners on all existing tabs
  for (int i = 0; i < SubstanceTabbedPaneUI.this.tabPane
      .getTabCount(); i++) {
    this.trackTab(SubstanceTabbedPaneUI.this.tabPane
        .getComponentAt(i));
  }
}

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

public void stateChanged(final ChangeEvent _e){
 final CtuluUndoRedoInterface selected = (CtuluUndoRedoInterface) pane_.getSelectedComponent();
 for (int j = pane_.getTabCount() - 1; j >= 0; j--) {
  if (pane_.getComponentAt(j) != selected) {
   ((CtuluUndoRedoInterface) pane_.getComponentAt(j)).setActive(false);
  }
 }
 l_.setActive(selected, true);
}

代码示例来源:origin: protegeproject/protege

@Override
  public void handleCloseTab(int tabIndex, JTabbedPane tabbedPane) {
    WorkspaceTab workspaceTab = (WorkspaceTab) tabbedPane.getComponentAt(tabIndex);
    workspaceTab.getWorkspace().removeTab(workspaceTab);
    try {
      workspaceTab.dispose();
    } catch (Exception e) {
      logger.error("An error occurred whilst disposing of a tab.", e);
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

private void replaceView(JSplitPane oldView, JSplitPane newView){
  for (int i=0; i < tabPane.getTabCount(); i++){
    if (oldView.equals(tabPane.getComponentAt(i))){
      tabPane.setComponentAt(i, newView);
      tabPane.setSelectedComponent(newView);
      tabPane.validate();
      copyFilterMask(oldView, newView);
      continue;
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private void checkResultTabLimit()
{
 SessionProperties props = _session.getProperties();
 while(props.getLimitSQLResultTabs() && props.getSqlResultTabLimit() < _tabbedExecutionsPanel.getTabCount())
 {
   if(_tabbedExecutionsPanel.getComponentAt(0) instanceof CancelPanel)
   {
    break;
   }
   closeTabAt(0);
 }
}

相关文章

JTabbedPane类方法