(JTabbedPane tabbedPane)
| 501 | |
| 502 | |
| 503 | public static String localCurrentTab(JTabbedPane tabbedPane) { |
| 504 | int selectedIndex = tabbedPane.getSelectedIndex(); |
| 505 | String tabTitle = ""; |
| 506 | if (selectedIndex != -1) { |
| 507 | tabTitle = tabbedPane.getTitleAt(selectedIndex); |
| 508 | System.out.println("当前标签:" + tabTitle); |
| 509 | } |
| 510 | return tabTitle; |
| 511 | } |
| 512 | |
| 513 | public static void switchTab(JTabbedPane tabbedPane, String tabName) { |
| 514 | for (int i = 0; i < tabbedPane.getTabCount(); i++) { |