本文整理了Java中javax.swing.JTabbedPane.setToolTipTextAt()
方法的一些代码示例,展示了JTabbedPane.setToolTipTextAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setToolTipTextAt()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setToolTipTextAt
暂无
代码示例来源:origin: igniterealtime/Smack
adhocMessages.setForeground(new Color(1, 94, 35));
tabbedPane.add("Ad-hoc message", new JScrollPane(adhocMessages));
tabbedPane.setToolTipTextAt(3, "Panel that allows you to send adhoc packets");
代码示例来源: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
tabbedPane.setToolTipTextAt(0, "Sent and received packets processed by Smack");
sentText.setForeground(new Color(112, 3, 3));
tabbedPane.add("Raw Sent Packets", new JScrollPane(sentText));
tabbedPane.setToolTipTextAt(1, "Raw text of the sent packets");
receivedText.setForeground(new Color(6, 76, 133));
tabbedPane.add("Raw Received Packets", new JScrollPane(receivedText));
tabbedPane.setToolTipTextAt(
2,
"Raw text of the received packets before Smack process them");
代码示例来源:origin: igniterealtime/Smack
tabbedPane.setToolTipTextAt(4, "Information and statistics about the debugged connection");
代码示例来源:origin: com.jidesoft/jide-oss
public void propertyChange(PropertyChangeEvent evt) {
if (AbstractDialogPage.PROPERTY_PAGE_ENABLED.equals(evt.getPropertyName())) {
_tabbedPane.setEnabledAt(index, Boolean.TRUE.equals(evt.getNewValue()));
}
else if (AbstractDialogPage.ICON_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setIconAt(index, (Icon) evt.getNewValue());
}
else if (AbstractDialogPage.TITLE_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setTitleAt(index, (String) evt.getNewValue());
}
else if (AbstractDialogPage.DESCRIPTION_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setToolTipTextAt(index, (String) evt.getNewValue());
}
}
});
代码示例来源:origin: com.jidesoft/jide-oss
public void propertyChange(PropertyChangeEvent evt) {
if (AbstractDialogPage.PROPERTY_PAGE_ENABLED.equals(evt.getPropertyName())) {
_tabbedPane.setEnabledAt(index, Boolean.TRUE.equals(evt.getNewValue()));
}
else if (AbstractDialogPage.ICON_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setIconAt(index, (Icon) evt.getNewValue());
}
else if (AbstractDialogPage.TITLE_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setTitleAt(index, (String) evt.getNewValue());
}
else if (AbstractDialogPage.DESCRIPTION_PROPERTY.equals(evt.getPropertyName())) {
_tabbedPane.setToolTipTextAt(index, (String) evt.getNewValue());
}
}
});
代码示例来源:origin: chatty/chatty
public void setTitleForComponent(Component comp, String title, String tooltip) {
int index = tabs.indexOfComponent(comp);
if (index != -1) {
tabs.setTitleAt(index, title);
tabs.setToolTipTextAt(index, tooltip);
}
}
代码示例来源: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 setToolTipTextAt(int index, String toolTipText) {
Component cmpt = this.getTabComponentAt(index);
if( cmpt instanceof TabQuery )((TabQuery)cmpt).setTabToolTipText(toolTipText);
super.setToolTipTextAt(index, toolTipText);
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing
@Override
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals(TabInfo.TITLE_PROPERTY)) {
tabs.setTitleAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) {
tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) {
tabs.setForegroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) {
tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) {
tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) {
tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.ICON_PROPERTY)) {
tabs.setIconAt(tabIndex, (Icon) e.getNewValue());
} else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) {
tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue());
}
}
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime
@Override
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals(TabInfo.TITLE_PROPERTY)) {
tabs.setTitleAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) {
tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) {
tabs.setForegroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) {
tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) {
tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) {
tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.ICON_PROPERTY)) {
tabs.setIconAt(tabIndex, (Icon) e.getNewValue());
} else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) {
tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue());
} else if (name.equals(TabInfo.TAB_COMPONENT_PROPERTY)) {
tabs.setTabComponentAt(tabIndex, (Component) e.getNewValue());
} else if (name.equals(TabInfo.ENABLED_PROPERTY)) {
tabs.setEnabledAt(tabIndex, (Boolean) e.getNewValue());
}
}
}
代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime
@Override
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals(TabInfo.TITLE_PROPERTY)) {
tabs.setTitleAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.TOOL_TIP_TEXT_PROPERTY)) {
tabs.setToolTipTextAt(tabIndex, (String) e.getNewValue());
} else if (name.equals(TabInfo.FOREGROUND_PROPERTY)) {
tabs.setForegroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.BACKGROUND_PROPERTY)) {
tabs.setBackgroundAt(tabIndex, (Color) e.getNewValue());
} else if (name.equals(TabInfo.MNEMONIC_PROPERTY)) {
tabs.setMnemonicAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.DISPLAYED_MNEMONIC_INDEX_PROPERTY)) {
tabs.setDisplayedMnemonicIndexAt(tabIndex, (Integer) e.getNewValue());
} else if (name.equals(TabInfo.ICON_PROPERTY)) {
tabs.setIconAt(tabIndex, (Icon) e.getNewValue());
} else if (name.equals(TabInfo.DISABLED_ICON_PROPERTY)) {
tabs.setDisabledIconAt(tabIndex, (Icon) e.getNewValue());
} else if (name.equals(TabInfo.TAB_COMPONENT_PROPERTY)) {
tabs.setTabComponentAt(tabIndex, (Component) e.getNewValue());
} else if (name.equals(TabInfo.ENABLED_PROPERTY)) {
tabs.setEnabledAt(tabIndex, (Boolean) e.getNewValue());
}
}
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
private void loadTabs()
{
_iAliasPropertiesPanelControllers.add(new SchemaPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new DriverPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new ColorPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new ConnectionPropertiesController(_alias, _app));
IAliasPropertiesPanelController[] pluginAliasPropertiesPanelControllers =
_app.getPluginManager().getAliasPropertiesPanelControllers(_alias);
_iAliasPropertiesPanelControllers.addAll(Arrays.asList(pluginAliasPropertiesPanelControllers));
for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++)
{
IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i);
int index = _frame.tabPane.getTabCount();
_frame.tabPane.add(aliasPropertiesController.getTitle(), aliasPropertiesController.getPanelComponent());
_frame.tabPane.setToolTipTextAt(index, aliasPropertiesController.getHint());
}
}
代码示例来源:origin: realXuJiang/bigtable-sql
private void loadTabs()
{
_iAliasPropertiesPanelControllers.add(new SchemaPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new DriverPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new ColorPropertiesController(_alias, _app));
_iAliasPropertiesPanelControllers.add(new ConnectionPropertiesController(_alias, _app));
IAliasPropertiesPanelController[] pluginAliasPropertiesPanelControllers =
_app.getPluginManager().getAliasPropertiesPanelControllers(_alias);
_iAliasPropertiesPanelControllers.addAll(Arrays.asList(pluginAliasPropertiesPanelControllers));
for (int i = 0; i < _iAliasPropertiesPanelControllers.size(); i++)
{
IAliasPropertiesPanelController aliasPropertiesController = _iAliasPropertiesPanelControllers.get(i);
int index = _frame.tabPane.getTabCount();
_frame.tabPane.add(aliasPropertiesController.getTitle(), aliasPropertiesController.getPanelComponent());
_frame.tabPane.setToolTipTextAt(index, aliasPropertiesController.getHint());
}
}
代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking
/** MouseListener implementation, use to track mouse behaviour inside the tab selector bounds
* and forward them to the appropriate smart icon.
*/
public void mouseExited(MouseEvent e) {
checkTabCount();
if(movedIcon != null) {
Point p = e.getPoint();
// trigger a mouseExit from the movedIcon
Rectangle prevRect = tabbedPane.getBoundsAt(movedTab);
if (prevRect == null) {
return;
}
Point iPoint = convertPointToIcon(prevRect, p, movedIcon);
MouseEvent eSmart = new MouseEvent((Component) e.getSource(), MouseEvent.MOUSE_EXITED, e.getWhen(), e.getModifiers(), iPoint.x, iPoint.y, e.getClickCount(), e.isPopupTrigger(), e.getButton());
if(movedIcon.onMouseExited(eSmart)) {
String tip = movedIcon.getLocalTooltipText();
if(tip != null && ! tip.equals(tabbedPane.getToolTipTextAt(movedTab))) {
tabbedPane.setToolTipTextAt(movedTab, tip);
}
tabbedPane.repaint(prevRect.x, prevRect.y, prevRect.width, prevRect.height);
}
movedIcon = null;
movedTab = - 1;
}
}
代码示例来源: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: org.littleshoot/smack-xmpp-3-2-2
/**
* 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: 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: org.java.net.substance/substance
public void mouseExited(MouseEvent e) {
setRolloverTab(-1);
// fix for bug 69 - non-selected non-rollover tab
// may remain with close button after moving mouse quickly
// to inner JTabbedPane
if ((this.prevRolledOver >= 0)
&& (this.prevRolledOver < SubstanceTabbedPaneUI.this.tabPane
.getTabCount())
&& SubstanceTabbedPaneUI.this.tabPane
.isEnabledAt(this.prevRolledOver)) {
// only the previously rolled-over tab needs to be
// repainted (fade-out) instead of repainting the
// whole tab as before.
StateTransitionTracker tracker = getTracker(prevRolledOver,
true, prevRolledOver == currSelectedIndex);
tracker.getModel().setRollover(false);
if (SubstanceCoreUtilities.getTabCloseCallback(e, tabPane,
this.prevRolledOver) != null) {
tabPane.setToolTipTextAt(this.prevRolledOver, null);
}
}
this.prevRolledOver = -1;
}
代码示例来源:origin: com.github.insubstantial/substance
@Override
public void mouseExited(MouseEvent e) {
setRolloverTab(-1);
// fix for bug 69 - non-selected non-rollover tab
// may remain with close button after moving mouse quickly
// to inner JTabbedPane
if ((this.prevRolledOver >= 0)
&& (this.prevRolledOver < SubstanceTabbedPaneUI.this.tabPane
.getTabCount())
&& SubstanceTabbedPaneUI.this.tabPane
.isEnabledAt(this.prevRolledOver)) {
// only the previously rolled-over tab needs to be
// repainted (fade-out) instead of repainting the
// whole tab as before.
StateTransitionTracker tracker = getTracker(prevRolledOver,
true, prevRolledOver == currSelectedIndex);
tracker.getModel().setRollover(false);
if (SubstanceCoreUtilities.getTabCloseCallback(e, tabPane,
this.prevRolledOver) != null) {
tabPane.setToolTipTextAt(this.prevRolledOver, null);
}
}
this.prevRolledOver = -1;
}
内容来源于网络,如有侵权,请联系作者删除!