// To create a tabbed pane, see e828 创建JTabbedPane // Get the index of the currently selected tab int selIndex = pane.getSelectedIndex(); // Select the last tab selIndex = pane.getTabCount()-1; pane.setSelectedIndex(selIndex);