JTabbedPane: getDisabledIconAt(int index)
import java.awt.Color;
import java.awt.Component;
import javax.swing.Icon;
import javax.swing.JTabbedPane;
public class Main {
public static void main(String[] argv) throws Exception {
JTabbedPane pane = new JTabbedPane();
int src = pane.getTabCount() - 1;
int dst = 0;
Component comp = pane.getComponentAt(src);
String label = pane.getTitleAt(src);
Icon icon = pane.getIconAt(src);
Icon iconDis = pane.getDisabledIconAt(src);
String tooltip = pane.getToolTipTextAt(src);
boolean enabled = pane.isEnabledAt(src);
int keycode = pane.getMnemonicAt(src);
int mnemonicLoc = pane.getDisplayedMnemonicIndexAt(src);
Color fg = pane.getForegroundAt(src);
Color bg = pane.getBackgroundAt(src);
pane.remove(src);
pane.insertTab(label, icon, comp, tooltip, dst);
pane.setDisabledIconAt(dst, iconDis);
pane.setEnabledAt(dst, enabled);
pane.setMnemonicAt(dst, keycode);
pane.setDisplayedMnemonicIndexAt(dst, mnemonicLoc);
pane.setForegroundAt(dst, fg);
pane.setBackgroundAt(dst, bg);
}
}
Related examples in the same category
1. | JTabbedPane.SCROLL_TAB_LAYOUT | | |
2. | JTabbedPane: addChangeListener(ChangeListener l) | | |
3. | JTabbedPane: addTab(String title, Component component) | | |
4. | JTabbedPane: addTab(String title, Icon icon, Component component, String tip) | | |
5. | JTabbedPane: getComponentAt(int index) | | |
6. | JTabbedPane: getDisplayedMnemonicIndexAt(int tabIndex) | | |
7. | JTabbedPane: getIconAt(int index) | | |
8. | JTabbedPane: getMnemonicAt(int tabIndex) | | |
9. | JTabbedPane: getTitleAt(int index) | | |
10. | JTabbedPane: getToolTipTextAt(int index) | | |
11. | JTabbedPane: indexOfComponent(Component component) | | |
12. | JTabbedPane: indexOfTab(String title) | | |
13. | JTabbedPane: insertTab(String title, Icon icon, Component component, String tip, int index) | | |
14. | JTabbedPane: isEnabledAt(int index) | | |
15. | JTabbedPane: remove(Component component) | | |
16. | JTabbedPane: removeAll() | | |
17. | JTabbedPane: removeTabAt(int index) | | |
18. | JTabbedPane: setBackgroundAt(int index, Color background) | | |
19. | JTabbedPane: setDisabledIconAt(int index, Icon disabledIcon) | | |
20. | JTabbedPane: setDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex) | | |
21. | JTabbedPane: setEnabledAt(int index, boolean enabled) | | |
22. | JTabbedPane: setForegroundAt(int index, Color foreground) | | |
23. | JTabbedPane: setMnemonicAt(int tabIndex, int mnemonic) | | |
24. | JTabbedPane: setSelectedIndex(int index) | | |
25. | JTabbedPane: setTabComponentAt(int index, Component component) | | |
26. | JTabbedPane: setTabLayoutPolicy(int tabLayoutPolicy) | | |
27. | JTabbedPane: setTabPlacement(int tabPlacement) | | |
28. | JTabbedPane: setToolTipTextAt(int index, String toolTipText) | | |