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

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

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

JTabbedPane.setIconAt介绍

暂无

代码示例

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

static synchronized void connectionEstablished(EnhancedDebugger debugger) {
  getInstance().tabbedPane.setIconAt(
      getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
      connectionActiveIcon);
}

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

/**
 * Notification that the connection was properly closed.
 *
 * @param debugger the debugger whose connection was properly closed.
 */
static synchronized void connectionClosed(EnhancedDebugger debugger) {
  getInstance().tabbedPane.setIconAt(
      getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
      connectionClosedIcon);
}

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

/**
 * Notification that the connection was closed due to an exception.
 *
 * @param debugger the debugger whose connection was closed due to an exception.
 * @param e        the exception.
 */
static synchronized void connectionClosedOnError(EnhancedDebugger debugger, Exception e) {
  int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
  getInstance().tabbedPane.setToolTipTextAt(
      index,
      "XMPPConnection closed due to the exception: " + e.getMessage());
  getInstance().tabbedPane.setIconAt(
      index,
      connectionClosedOnErrorIcon);
}

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

/**
 * Notification that a user has logged in to the server. A new title will be set
 * to the tab of the given debugger.
 *
 * @param debugger the debugger whose connection logged in to the server
 * @param user     the user@host/resource that has just logged in
 */
static synchronized void userHasLogged(EnhancedDebugger debugger, String user) {
  int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
  getInstance().tabbedPane.setTitleAt(
      index,
      user);
  getInstance().tabbedPane.setIconAt(
      index,
      connectionActiveIcon);
}

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

@Override
  public void componentAdded(ContainerEvent e) {
    int numTabs = tabbedPane.getTabCount() - 1;
    if (numTabs > 1) {
      for (int i = 0; i < numTabs; i++) {
        tabbedPane.setIconAt(i, CLOSE_TAB_ICON);
      }
    }
  }
});

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

@Override
public void componentRemoved(ContainerEvent e) {
  int numTabs = tabbedPane.getTabCount() - 1;
  for (int i = 0; i < numTabs; i++) {
    tabbedPane.setTitleAt(i, "TM " + Integer.toString(i));
    tabbedPane.setIconAt(i, CLOSE_TAB_ICON);
  }
  if (numTabs == 1) {
    tabbedPane.setIconAt(0, null);
  }
}

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

private void addMoreChatsTab(int index) {
  chats.add(contactList);
  //workaround for #171890
  chats.setTitleAt(0, "");
  chats.setIconAt(index, ImageUtilities.loadImageIcon(PLUS, true));
  //chats.setEnabledAt(index, false);
  chats.setToolTipTextAt(index, NbBundle.getMessage(ChatTopComponent.class, "LBL_MoreChats"));
}
private void putLoginScreen() {

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

@Override
public void setIconAt(int index, Icon icon) {
  Component cmpt = this.getTabComponentAt(index);
  if( cmpt instanceof TabQuery )((TabQuery)cmpt).setTabIcon(icon);
  super.setIconAt(index, icon);
}

代码示例来源:origin: net.sf.taverna.t2.ui-exts/perspective-biocatalogue

protected void setSpinnerIconForTab(TYPE resourceType) {
 tabbedSearchResultPanel.setIconAt(getTabIndexForResourceType(resourceType), ResourceManager.getImageIcon(ResourceManager.SPINNER));
}

代码示例来源:origin: net.sf.taverna.t2.ui-exts/perspective-biocatalogue

protected void setDefaultIconForTab(TYPE resourceType) {
 this.tabbedSearchResultPanel.setIconAt(getTabIndexForResourceType(resourceType), resourceType.getIcon());
}

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

synchronized static void connectionEstablished(EnhancedDebugger debugger) {
  getInstance().tabbedPane.setIconAt(
      getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
      connectionActiveIcon);
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

/**
 * Notification that the connection was properly closed.
 *
 * @param debugger the debugger whose connection was properly closed.
 */
synchronized static void connectionClosed(EnhancedDebugger debugger) {
  getInstance().tabbedPane.setIconAt(
      getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
      connectionClosedIcon);
}

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

/**
 * Notification that the connection was properly closed.
 *
 * @param debugger the debugger whose connection was properly closed.
 */
synchronized static void connectionClosed(EnhancedDebugger debugger) {
  getInstance().tabbedPane.setIconAt(
      getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane),
      connectionClosedIcon);
}

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

/**
 * Swap the tab at index i with that at index i+1
 */
private void swapTabs(int i) {
  Component c = tabs.getComponentAt(i);
  String text = tabs.getTitleAt(i);
  Icon icon = tabs.getIconAt(i);
  tabs.remove(i);
  tabs.add(c, text, i + 1);
  if (icon != null) {
    tabs.setIconAt(i + 1, icon);
  }
}

代码示例来源:origin: de.richtercloud/flexdock-core

private void addTab(JTabbedPane tabs, Component comp) {
  String tabText = getValidTabTitle(tabs, comp);
  tabs.add(comp, tabText);
  Dockable d = DockingManager.getDockable(comp);
  if (d == null) {
    return;
  }
  Icon icon = d.getDockingProperties().getTabIcon();
  int indx = tabs.getTabCount() - 1;
  tabs.setIconAt(indx, icon);
}

代码示例来源: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: net.sourceforge.jadex/jadex-runtimetools-swing

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

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

/**
 * Notification that the connection was closed due to an exception.
 *
 * @param debugger the debugger whose connection was closed due to an exception.
 * @param e        the exception.
 */
synchronized static void connectionClosedOnError(EnhancedDebugger debugger, Exception e) {
  int index = getInstance().tabbedPane.indexOfComponent(debugger.tabbedPane);
  getInstance().tabbedPane.setToolTipTextAt(
      index,
      "Connection closed due to the exception: " + e.getMessage());
  getInstance().tabbedPane.setIconAt(
      index,
      connectionClosedOnErrorIcon);
}

代码示例来源:origin: de.richtercloud/flexdock-core

protected void updateTab(Dockable dockable) {
  Component docked = getDockedComponent();
  if (docked instanceof JTabbedPane) {
    JTabbedPane tabs = (JTabbedPane) docked;
    int index = tabs.indexOfComponent(dockable.getComponent());
    if (index > -1) {
      tabs.setIconAt(index, dockable.getDockingProperties()
              .getTabIcon());
      tabs.setTitleAt(index, dockable.getDockingProperties()
              .getDockableDesc());
    }
  }
}

相关文章

JTabbedPane类方法