本文整理了Java中javax.swing.JTabbedPane.indexOfTabComponent()
方法的一些代码示例,展示了JTabbedPane.indexOfTabComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.indexOfTabComponent()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:indexOfTabComponent
暂无
代码示例来源:origin: JetBrains/jediterm
@Override
public int indexOfTabComponent(Component component) {
return myTabbedPane.indexOfTabComponent(component);
}
代码示例来源:origin: otros-systems/otroslogviewer
protected void closeTab() {
int tabNumber = jTabbedPane.indexOfTabComponent(TabHeader.this);
if (tabNumber != -1) {
int showConfirmDialog = JOptionPane.showConfirmDialog(jTabbedPane, "Do you really want to close \"" + label.getText() + "\"?", "Are you sure?",
JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (showConfirmDialog == JOptionPane.OK_OPTION) {
jTabbedPane.remove(tabNumber);
}
}
}
代码示例来源:origin: com.gitlab.cdc-java.ui/cdc-ui-swing
@Override
public void actionPerformed(ActionEvent e) {
final int index = wOwner.indexOfTabComponent(TabCloseButton.this);
if (index == -1) {
assert false;
} else {
wOwner.removeTabAt(index);
}
}
代码示例来源:origin: net.sf.ingenias/editor
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: sing-group/GC4S
private void closeTab() {
int index = pane.indexOfTabComponent(ButtonTabComponent.this);
if (index != -1) {
pane.remove(index);
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public String getText() {
int index = m_enclosingPane
.indexOfTabComponent(CloseableTabTitle.this);
if (index >= 0) {
return m_enclosingPane.getTitleAt(index);
}
return null;
}
};
代码示例来源: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: net.sf.ingenias/editor
public String getText() {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
return pane.getTitleAt(i);
}
return null;
}
};
代码示例来源:origin: fr.inria.wimmics/kggui
public String getText() {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
return pane.getTitleAt(i);
}
return null;
}
};
代码示例来源:origin: Wimmics/corese
public String getText() {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
return pane.getTitleAt(i);
}
return null;
}
};
代码示例来源:origin: wildfly/wildfly-core
public void actionPerformed(ActionEvent e) {
int i = pane.indexOfTabComponent(ButtonTabComponent.this);
if (i != -1) {
pane.remove(i);
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public String getText() {
int index = m_enclosingPane.indexOfTabComponent(CloseableTabTitle.this);
if (index >= 0) {
return m_enclosingPane.getTitleAt(index);
}
return null;
}
};
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public void actionPerformed(ActionEvent e) {
int i = m_enclosingPane.indexOfTabComponent(CloseableTabTitle.this);
if (i >= 0) {
if (m_callback != null) {
m_callback.tabClosing(i);
}
}
}
代码示例来源:origin: sing-group/GC4S
private void closeOtherTabs() {
int index = pane.indexOfTabComponent(ButtonTabComponent.this);
if (index != -1) {
for (int toRemove = pane.getTabCount() - 1; toRemove >= 0; toRemove--) {
if (toRemove != index) {
pane.remove(toRemove);
}
}
}
}
}
代码示例来源:origin: Waikato/weka-trunk
@Override
public void actionPerformed(ActionEvent e) {
int i = m_enclosingPane.indexOfTabComponent(CloseableTabTitle.this);
if (i >= 0 && getAllowMultipleTabs()) {
// m_enclosingPane.remove(i);
m_mainKFPerspective.removeTab(i);
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public void actionPerformed(ActionEvent e) {
int i = m_enclosingPane.indexOfTabComponent(CloseableTabTitle.this);
if (i >= 0 && getAllowMultipleTabs()) {
// m_enclosingPane.remove(i);
m_mainKFPerspective.removeTab(i);
}
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
@Override
public void actionPerformed(ActionEvent event) {
if (getTabPanel().indexOfTabComponent(TabLabelButton.this)==getTabPanel().getSelectedIndex()){
if (getCloseButtonListener()!=null){
getCloseButtonListener().actionPerformed(event);
}
}else{
getTabPanel().setSelectedIndex(getTabPanel().indexOfTabComponent(TabLabelButton.this));
}
}
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
public String getText() {
int i = pane.indexOfTabComponent(TabLabelButton.this);
if (i != -1) {
if (!pane.getTitleAt(i).equals(previousText)){
previousText=pane.getTitleAt(i);
TabLabelButton.this.updateUI();
}
return previousText;
}
return null;
}
};
代码示例来源:origin: com.jtattoo/JTattoo
public void remove(Component comp) {
int index = tabPane.indexOfTabComponent(comp);
PropertyChangeListener[] listeners = comp.getPropertyChangeListeners();
for (int j = 0; j < listeners.length; j++) {
if (listeners[j] instanceof MyTabComponentListener) {
comp.removePropertyChangeListener(listeners[j]);
}
}
super.remove(comp);
if (notifyTabbedPane && index != -1) {
tabPane.setTabComponentAt(index, null);
}
}
内容来源于网络,如有侵权,请联系作者删除!