本文整理了Java中javax.swing.JTabbedPane.setForegroundAt()
方法的一些代码示例,展示了JTabbedPane.setForegroundAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setForegroundAt()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setForegroundAt
暂无
代码示例来源:origin: chatty/chatty
public void setForegroundAt(int index, Color foreground) {
tabs.setForegroundAt(index, foreground);
}
代码示例来源:origin: chatty/chatty
public void setForegroundForComponent(Component comp, Color foreground) {
int index = tabs.indexOfComponent(comp);
if (index != -1) {
tabs.setForegroundAt(index,foreground);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
void setModified(ChatPanel panel) {
int i=chats.indexOfComponent(panel);
chats.setForegroundAt(i, Color.BLUE);
}
代码示例来源:origin: LibraryOfCongress/bagger
@Override
public void stateChanged(ChangeEvent changeEvent) {
JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource();
int count = sourceTabbedPane.getTabCount();
int selected = sourceTabbedPane.getSelectedIndex();
for (int i = 0; i < count; ++i) {
Color c = (i == selected) ? unselectedColor : selectedColor;
sourceTabbedPane.setBackgroundAt(i, c);
sourceTabbedPane.setForegroundAt(i, c);
}
}
};
代码示例来源:origin: xyz.cofe/gui.swing
@Override
public void setForegroundAt(int index, Color foreground) {
Component cmpt = this.getTabComponentAt(index);
if( cmpt instanceof TabQuery )((TabQuery)cmpt).setTabForeground(foreground);
super.setForegroundAt(index, foreground);
}
代码示例来源: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: Audiveris/audiveris
stubsPane.setForegroundAt(tabIndex, color);
代码示例来源:origin: stackoverflow.com
pane.setForegroundAt(1, Color.green);
pane.setBackgroundAt(1, Color.orange);
} else {
pane.setForegroundAt(1, defaultForeColor);
pane.setBackgroundAt(1, defaultBackColor);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui
public void stateChanged(ChangeEvent changeEvent) {
int index = chats.getSelectedIndex();
if (index>=0) {
chats.setForegroundAt(index, Color.BLACK);
if (!initInProgress) {
String name = chats.getComponentAt(index).getName();
if (name!=null) {
final ChatNotifications notifications = ChatNotifications.getDefault();
notifications.removeGroup(name);
//TODO: WTH is this line?
//name = name.substring(name.indexOf('.') + 1);
notifications.removePrivate(name);
}
}
chats.getComponentAt(index).requestFocus();
}
}
};
代码示例来源:origin: org.biojava.thirdparty/forester
@Override
public void stateChanged( final ChangeEvent evt ) {
final JTabbedPane pane = ( JTabbedPane ) evt.getSource();
getControlPanel().tabChanged();
// Get current tab
final int sel = pane.getSelectedIndex();
if ( sel >= 0 ) {
if ( !getConfiguration().isUseNativeUI() ) {
if ( _tabbed_pane.getTabCount() > 0 ) {
_tabbed_pane.setForegroundAt( sel, Constants.TAB_LABEL_FOREGROUND_COLOR_SELECTED );
for( int i = 0; i < _tabbed_pane.getTabCount(); ++i ) {
if ( i != sel ) {
_tabbed_pane.setBackgroundAt( i, getConfiguration().getGuiBackgroundColor() );
_tabbed_pane.setForegroundAt( i, getConfiguration().getGuiCheckboxTextColor() );
}
}
}
}
}
}
} );
代码示例来源:origin: stackoverflow.com
pane.setForegroundAt(i, Color.white);
代码示例来源:origin: Audiveris/audiveris
/**
* Adjust color and title for tab of each displayed stub in the provided book.
*
* @param book the provided book
*/
public void adjustStubTabs (Book book)
{
SheetStub firstDisplayed = null;
for (SheetStub stub : book.getStubs()) {
int tabIndex = stubsPane.indexOfComponent(stub.getAssembly().getComponent());
if (tabIndex != -1) {
if (firstDisplayed == null) {
firstDisplayed = stub;
}
if (!stub.isValid()) {
stubsPane.setForegroundAt(tabIndex, Colors.SHEET_INVALID);
}
stubsPane.setTitleAt(tabIndex, defineTitleFor(stub, firstDisplayed));
}
}
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
Component comp2 = tabbedPane.getComponentAt(i);
if (comp2!=null && comp2.equals(comp)) {
tabbedPane.setForegroundAt(i, foreground);
selectTab(tabbedPane, i);
break;
内容来源于网络,如有侵权,请联系作者删除!