本文整理了Java中javax.swing.JTabbedPane.getComponentCount()
方法的一些代码示例,展示了JTabbedPane.getComponentCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getComponentCount()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getComponentCount
暂无
代码示例来源: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: igniterealtime/Smack
/**
* Shows the new debugger in the debug window.
*
* @param debugger the new debugger to show
*/
private void showNewDebugger(EnhancedDebugger debugger) {
if (frame == null) {
createDebug();
}
debugger.tabbedPane.setName("XMPPConnection_" + tabbedPane.getComponentCount());
tabbedPane.add(debugger.tabbedPane, tabbedPane.getComponentCount() - 1);
tabbedPane.setIconAt(tabbedPane.indexOfComponent(debugger.tabbedPane), connectionCreatedIcon);
frame.setTitle(
"Smack Debug Window -- Total connections: " + (tabbedPane.getComponentCount() - 1));
// Keep the added debugger for later access
debuggers.add(debugger);
}
代码示例来源: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: edu.stanford.protege/org.protege.editor.core.application
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) {
if (tabPane.getComponentCount() > 1) {
return TAB_HEIGHT;
}
else {
return 0;
}
}
代码示例来源:origin: org.protege/protege-editor-core-application
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) {
if (tabPane.getComponentCount() > 1) {
return TAB_HEIGHT;
}
else {
return 0;
}
}
代码示例来源:origin: Audiveris/audiveris
@Override
public void actionPerformed (ActionEvent e)
{
int count = stubsPane.getComponentCount();
if (count > 0) {
stubsPane.setSelectedIndex(count - 1);
}
}
代码示例来源:origin: pvto/konte-art
private void switchToTab(int add) {
int ind = tabs.getSelectedIndex();
int newInd = (ind + add) % tabs.getComponentCount();
if (newInd < 0)
newInd += tabs.getComponentCount();
tabs.setSelectedIndex(newInd);
}
代码示例来源:origin: Audiveris/audiveris
@Override
public void actionPerformed (ActionEvent e)
{
int tabIndex = stubsPane.getSelectedIndex();
if (tabIndex < (stubsPane.getComponentCount() - 1)) {
stubsPane.setSelectedIndex(tabIndex + 1);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
public static int getNextSubTabIndex(JTabbedPane tabs, int tabIndex) {
int nextTabIndex = tabIndex;
for (int i = 0; i < tabs.getComponentCount(); i++) {
nextTabIndex++;
if (nextTabIndex == tabs.getComponentCount()) {
nextTabIndex = 0;
}
if (tabs.isEnabledAt(nextTabIndex)) {
break;
}
}
return nextTabIndex;
}
代码示例来源:origin: protegeproject/protege
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) {
if (tabPane.getComponentCount() > 1) {
return getTabHeight();
}
else {
return 0;
}
}
代码示例来源:origin: protegeproject/protege
public void componentAdded(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 1) {
ViewHolder.this.add(tabbedHolder);
}
}
代码示例来源:origin: Jamling/SmartIM
public void randBling() {
int size = tabbedChat.getComponentCount();
int i = new Random().nextInt(size);
String name = "Random";
if (i >= 0 && tabbedChat instanceof ClosableTabHost) {
((ClosableTabHost) tabbedChat).bling(i, name);
}
}
代码示例来源:origin: org.protege/protege-editor-core-application
public void componentRemoved(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 0) {
ViewHolder.this.remove(tabbedHolder);
}
}
});
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
public void componentRemoved(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 0) {
ViewHolder.this.remove(tabbedHolder);
}
}
});
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
public void componentAdded(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 1) {
ViewHolder.this.add(tabbedHolder);
}
}
代码示例来源:origin: org.protege/protege-editor-core-application
public void componentAdded(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 1) {
ViewHolder.this.add(tabbedHolder);
}
}
代码示例来源:origin: protegeproject/protege
public void componentRemoved(ContainerEvent e) {
if (tabbedHolder.getComponentCount() == 0) {
ViewHolder.this.remove(tabbedHolder);
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
public void actionPerformed(ActionEvent e)
{
((DefaultListModel)sentmsgs.getModel()).removeAllElements();
((DefaultListModel)receivedmsgs.getModel()).removeAllElements();
while(tabs.getComponentCount()>1)
tabs.remove(1);
}
});
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = COUNT_JSDOC)
@Undesignable
@Override
public int getCount() {
return super.getComponentCount();
}
代码示例来源: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);
}
});
内容来源于网络,如有侵权,请联系作者删除!