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

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

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

JTabbedPane.setComponentAt介绍

暂无

代码示例

代码示例来源:origin: net.sf.mmax2/mmax2

private final void clearResultTupleTable()
{
  resultPane.setComponentAt(0, new JScrollPane(null));
  resultPane.setTitleAt(0, "Markable Tuples");
  clearButton.setEnabled(false);  
  
}

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void setComponentAt(int index, Component component) {
  Component cmpt = this.getTabComponentAt(index);
  if( cmpt instanceof TabQuery )((TabQuery)cmpt).setTabOwner(component);
  super.setComponentAt(index, component);
}

代码示例来源:origin: net.sourceforge.jadex/jadex-rules-tools

/**
 *  Add an info panel (right hand side).
 */
public void addInfoPanel(String name, JComponent panel)
{
  boolean	found	= false;
  for(int i=0; !found && i<infopanels.getTabCount(); i++)
    if(name.equals(infopanels.getTitleAt(i)))
      // claas - removed - @since 1.6
      //infopanels.setTabComponentAt(i, panel);
      infopanels.setComponentAt(i, panel);
  if(!found)
    infopanels.addTab(name, panel);
  infopanels.setSelectedComponent(panel);
}

代码示例来源:origin: com.jidesoft/jide-oss

public void setComponentAt(int index, Component c) {
  Component oldComponent = getComponentAt(index);
  if (oldComponent != null) {
    // JTabbedPane allows a null c, but doesn't really support it.
    PageLastFocusTracker tracker = (PageLastFocusTracker) _pageLastFocusTrackers.get(oldComponent);
    _pageLastFocusTrackers.remove(oldComponent);
    if (tracker != null) {
      tracker.setHeighestComponent(null); // Clear its listeners
    }
  }
  boolean contains = false;
  if (_closableSet.contains(oldComponent)) {
    contains = true;
  }
  super.setComponentAt(index, c);
  if (contains) {
    _closableSet.add(c);
  }
  if (!isAutoFocusOnTabHideClose())
    clearVisComp();
}

代码示例来源:origin: ggp-org/ggp-base

tabs.setComponentAt(stepNum-1, statePanel);
tabs.setTitleAt(stepNum-1, new Integer(stepNum).toString());

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Sets the main "about this application" panel.
 *
 * @param panel The panel.
 * @see #addPanel(String, Component)
 */
public void setApplicationPanel(Component panel) {
  if (appPanel!=null) { // Replacing old app panel (uncommon)
    tabbedPane.removeTabAt(0);
    tabbedPane.setComponentAt(0, panel);
    appPanel = panel;
  }
  else if (panel==null) { // Removing app panel (uncommon)
    tabbedPane.removeTabAt(0);
    appPanel = null;
  }
  else { // Adding app panel
    String title = MSG.getString("Tab.Application");
    tabbedPane.insertTab(title, null, panel, null, 0);
    appPanel = panel;
  }
}

代码示例来源: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: ggp-org/ggp-base

@Override
  public void render() {
    JPanel newPanel = null;
    try {
      String XML = Match.renderStateXML(state.getContents());
      String XSL = theGame.getStylesheet();
      if (XSL != null) {
        newPanel = new VizContainerPanel(XML, XSL, myThis);
      }
    } catch(Exception ex) {
      ex.printStackTrace();
    }
    if(newPanel != null) {
      boolean atEnd = (tabs.getSelectedIndex() == tabs.getTabCount()-1);
      try {
        for(int i = tabs.getTabCount(); i < stepNum; i++)
          tabs.add(new Integer(i+1).toString(), new JPanel());
        tabs.setComponentAt(stepNum-1, newPanel);
        tabs.setTitleAt(stepNum-1, new Integer(stepNum).toString());
        if(atEnd) {
          tabs.setSelectedIndex(tabs.getTabCount()-1);
        }
      } catch(Exception ex) {
        System.err.println("Adding rendered visualization panel failed for: " + theGame.getKey());
      }
    }
  }
}

代码示例来源:origin: net.sf.mmax2/mmax2

pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
resultPane.setComponentAt(0, pane);
resultPane.setTitleAt(0, "Markable Tuples ("+queryResultTuples.size()+")");
clearButton.setEnabled(true);
resultPane.setComponentAt(0, new JScrollPane(null));
resultPane.setTitleAt(0, "Markable Tuples (0)");                        
clearButton.setEnabled(false);
resultPane.setComponentAt(0, new JScrollPane(null));
resultPane.setTitleAt(0, "Markable Tuples");                        
clearButton.setEnabled(false);

代码示例来源:origin: net.sf.taverna.t2.ui-impl/zaria

public void swap(ZTreeNode oldComponent, ZTreeNode newComponent) {
  // Find the tab index, if any, of the old component
  int componentIndex = -1;
  for (int i = 0; i < tabs.getComponentCount() && componentIndex < 0; i++) {
    if (tabs.getComponentAt(i) == oldComponent) {
      componentIndex = i;
    }
  }
  if (componentIndex == -1) {
    // Give up, couldn't find the old component
    return;
  }
  oldComponent.discard();
  newComponent.setEditable(editable);
  tabs.setComponentAt(componentIndex, (JComponent) newComponent);
}

代码示例来源:origin: girtel/Net2Plan

tabbedPane.setComponentAt(trafficMatrixId, pane);

代码示例来源:origin: JetBrains/jediterm

@Override
public void setComponentAt(int index, Component component) {
 super.setComponentAt(index, component);
 component.addHierarchyListener(this);
 UIUtil.setNotOpaqueRecursively(component);
 setInsets(component);
 revalidate();
 repaint();
}

代码示例来源:origin: fcrepo3/fcrepo

/**
 * Set the content of the "New..." JPanel to a fresh new datastream entry
 * panel, and switch to it, if needed.
 */
public void doNew(String[] dropdownMimeTypes, boolean makeSelected) {
  int i = getTabIndex("New...");
  m_tabbedPane
      .setComponentAt(i, new NewDatastreamPane(dropdownMimeTypes));
  i = getTabIndex("New...");
  m_tabbedPane.setToolTipTextAt(i, "Add a new datastream to this object");
  m_tabbedPane.setIconAt(i, newIcon);
  m_tabbedPane.setBackgroundAt(i, Administrator.DEFAULT_COLOR);
  if (makeSelected) {
    m_tabbedPane.setSelectedIndex(i);
  }
}

代码示例来源:origin: fcrepo3/fcrepo

/**
 * Refresh the content of the tab for the indicated datastream with the
 * latest information from the server.
 */
protected void refresh(String dsID) {
  int i = getTabIndex(dsID);
  try {
    List<Datastream> versions =
        Administrator.APIM.getDatastreamHistory(m_pid, dsID);
    m_currentVersionMap.put(dsID, versions.get(i));
    logger.debug("New create date is: " + versions.get(i).getCreateDate());
    DatastreamPane replacement =
        new DatastreamPane(m_owner, m_pid, versions, this);
    m_datastreamPanes[i] = replacement;
    m_tabbedPane.setComponentAt(i, replacement);
    m_tabbedPane.setToolTipTextAt(i, versions.get(i).getMIMEType() + " - "
        + versions.get(i).getLabel() + " ("
        + versions.get(i).getControlGroup().toString() + ")");
    colorTabForState(dsID, versions.get(i).getState());
    setDirty(dsID, false);
  } catch (Exception e) {
    Administrator
        .showErrorDialog(Administrator.getDesktop(),
                 "Error while refreshing",
                 e.getMessage()
                     + "\nTry re-opening the object viewer.",
                 e);
  }
}

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

int currentIndex = getTabCount() - 1;
setTabComponentAt(currentIndex, new JLabel(title));
setComponentAt(currentIndex, content);

代码示例来源:origin: cmu-phil/tetrad

tabbedPane.setComponentAt(2, new DataEditor(wrapper, false, JTabbedPane.LEFT));
tabbedPane.setComponentAt(2, new DataEditor(wrapper, false, JTabbedPane.LEFT));

代码示例来源:origin: cmu-phil/tetrad

tabbedPane.setComponentAt(0, new PaddingPanel(getParameterPanel(simulation, simulation.getSimulation(), simulation.getParams())));

代码示例来源:origin: org.xworker/xworker_core

if(c != null){
  int index = parent.getTabCount();
  parent.setComponentAt(index, c);

相关文章

JTabbedPane类方法