This chapter describes in detail the troubleshooting tools that are available in JDK 7. In addition, the chapter lists operating-system-specific tools that may be used in conjunction with these troubleshooting tools. Finally, the chapter explains how
// Create a tabbed pane JTabbedPane pane = new JTabbedPane(); // Set the text color for all tabs pane.setForeground(Color.YELLOW); // Set the background color for all tabs pane.setBackground(Color.MAGENTA); // Add a tab String label = "Tab Label"
// To create a tabbed pane, see e828 创建JTabbedPane // Remove the last tab pane.remove(pane.getTabCount()-1); // Remove the tab with the specified child component pane.remove(component); // Remove all the tabs pane.removeAll(); Related Examples
Setting a mnemonic on a tab allows the tab to be selected with a keystroke. For example, if the mnemonic for a tab were the key L, then typing ALT-L (on Windows) would select the tab. // Create a tabbed pane JTabbedPane pane = new JTabbedPane(); // A
To move a tab, it must first be removed and then reinserted into the tabbed pane as a new tab. Unfortunately, since there is no object that represents a tab, it is necessary to record all of the tab's properties before moving it and to restore them a
By default, all new tabs are enabled, which means the user can select them. A tab can be disabled to prevent the user from selecting it. // Create a tabbed pane JTabbedPane pane = new JTabbedPane(); // Add a tab pane.addTab("Tab Label", componen