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

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

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

JTabbedPane.remove介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

@Override
public void removeDeviceView(DeviceView deviceView) {
  Component comp = tabs.get(deviceView);
  if (comp != null) {
    tabs.remove(deviceView);
    tabbedPane.remove(deviceView.asUIComponent());
  }
}

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Remove the selected tab pane if it's not the Smack info pane
    if (tabbedPane.getSelectedIndex() < tabbedPane.getComponentCount() - 1) {
      int index = tabbedPane.getSelectedIndex();
      // Notify to the debugger to stop debugging
      EnhancedDebugger debugger = debuggers.get(index);
      debugger.cancel();
      // Remove the debugger from the root window
      tabbedPane.remove(debugger.tabbedPane);
      debuggers.remove(debugger);
      // Update the root window title
      frame.setTitle(
          "Smack Debug Window -- Total connections: "
              + (tabbedPane.getComponentCount() - 1));
    }
  }
});

代码示例来源: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: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    ArrayList<EnhancedDebugger> debuggersToRemove = new ArrayList<>();
    // Remove all the debuggers of which their connections are no longer valid
    for (int index = 0; index < tabbedPane.getComponentCount() - 1; index++) {
      EnhancedDebugger debugger = debuggers.get(index);
      if (!debugger.isConnectionActive()) {
        // Notify to the debugger to stop debugging
        debugger.cancel();
        debuggersToRemove.add(debugger);
      }
    }
    for (EnhancedDebugger debugger : debuggersToRemove) {
      // Remove the debugger from the root window
      tabbedPane.remove(debugger.tabbedPane);
      debuggers.remove(debugger);
    }
    // Update the root window title
    frame.setTitle(
        "Smack Debug Window -- Total connections: "
            + (tabbedPane.getComponentCount() - 1));
  }
});

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

public void closeFile() {
  for (OpenFile co : hmap) {
    int pos = house.indexOfTab(co.name);
    if (pos >= 0)
      house.remove(pos);
    co.close();
  }
  final State oldState = state;
  Model.this.state = null;
  if (oldState != null) {
    Closer.tryClose(oldState);
  }
  hmap.clear();
  tree.setModel(new DefaultTreeModel(null));
  metadataSystem = new MetadataSystem(typeLoader);
  file = null;
  treeExpansionState = null;
  open = false;
  mainWindow.onFileLoadEnded(file, open);
}

代码示例来源:origin: knowm/XChart

tabbedPane.remove(i);

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

/**
 * Convenience method to remove a workspace tab. If the tab is discarded then its <code>dispose()</code> method must
 * be called.
 *
 * @param workspaceTab The tab to be removed.
 */
public void removeTab(WorkspaceTab workspaceTab) {
  tabbedPane.remove(workspaceTab);
  workspaceTabs.remove(workspaceTab);
}

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

public void actionPerformed(ActionEvent arg0) {
  int index = tabs.getSelectedIndex();
  tabs.remove(index);
  checkValidity();
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

/**
 * Removes a proifile fro the context.
 * @param profileId the ID of the profile to remove.
 */
public void remove(String profileId) {
  tabbedPane.remove(profiles.remove(profileId));
}

代码示例来源:origin: org.apache.poi/poi-contrib

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   if (JOptionPane.showConfirmDialog(sheetPane, "Are you sure that you want to delete the selected sheet", "Delete Sheet?", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
    wb.removeSheetAt(tabIndex);
    sheetPane.remove(tabIndex);
   }
  }
 }
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

public void actionPerformed(ActionEvent e) {
  int i = pane.indexOfTabComponent(ButtonTabComponent.this);
  if (i != -1) {
    pane.remove(i);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-cli

public void actionPerformed(ActionEvent e) {
  int i = pane.indexOfTabComponent(ButtonTabComponent.this);
  if (i != -1) {
    pane.remove(i);
  }
}

代码示例来源:origin: org.apache.poi/poi-examples

@Override
 public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   if (JOptionPane.showConfirmDialog(sheetPane, "Are you sure that you want to delete the selected sheet", "Delete Sheet?", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
    wb.removeSheetAt(tabIndex);
    sheetPane.remove(tabIndex);
   }
  }
 }
}

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

/**
 * Removes specified component from the CytoPanel.
 *
 * @param component Component reference.
 */
public void remove(Component component) {
  // remove tab from JTabbedPane (component)
  tabbedPane.remove(component);
  // send out a notification
  notifyListeners(NOTIFICATION_COMPONENT_REMOVED);
}

代码示例来源:origin: uk.org.mygrid.taverna.scufl.scufl-ui-components/enactor-invocation

/**
 * Remove the detailed enactor progress report as a tree
 */
public void rmvProgressReport() {
  try {
    tabs.remove(tabs.indexOfTab("Process report"));
  } catch (Exception ex) {
  }
}

代码示例来源:origin: sanity/tahrir

@Override
  public void actionPerformed(final ActionEvent e) {
    final int tabIndex = tabbedPane.indexOfTabComponent(parent);
    if (tabIndex != TAB_NOT_FOUND) {
      tabbedPane.remove(tabIndex);
    }
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

public void actionPerformed(ActionEvent e) {
  int tabIndex = sheetPane.getSelectedIndex();
  if (tabIndex != -1) {
   if (JOptionPane.showConfirmDialog(sheetPane, "Are you sure that you want to delete the selected sheet", "Delete Sheet?", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
    wb.removeSheetAt(tabIndex);
    sheetPane.remove(tabIndex);
   }
  }
 }
}

代码示例来源:origin: javax.help/javahelp

public void removeNavigator(JHelpNavigator nav) {
  debug("removeNavigator");
  navs.removeElement(nav);
  tabbedPane.remove(nav);
  help.invalidate();
}

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

private void closeResultTab(ResultTab tab)
{
  if (tab == null)
  {
    throw new IllegalArgumentException("Null ResultTab passed");
  }
  s_log
      .debug("SQLPanel.closeResultTab(" + tab.getIdentifier().toString()
       + ")");
  tab.closeTab();
  _tabbedExecutionsPanel.remove(tab);
}

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

public void actionPerformed(ActionEvent e)
  {
    ((DefaultListModel)sentmsgs.getModel()).removeAllElements();
    ((DefaultListModel)receivedmsgs.getModel()).removeAllElements();
    while(tabs.getComponentCount()>1)
      tabs.remove(1);
  }
});

相关文章

JTabbedPane类方法