想要的顺序是先切换到第二个tab页签,然后在执行下面的修改配置文件等三个方法。目前情况是执行完三个方法后,才切换到第二个tab页签,明明tabPane.setSelectedIndex(1);在方法前面,为什么却没执行呢?
//开始安装按钮
if (e.getSource().equals(button3)) {
//点击确认进入安装的tab页
tabPane.setSelectedIndex(1);
tabPane.setEnabledAt(0, false);
//进度条开始
progressBar.setValue(1);
mysql_username = text3.getText();
mysql_password = new String(text4.getPassword());
//修改配置文件
generateConfiguration(tomcat_dir_path, project_dir_path, mysql_username, mysql_password);
//移动项目至指定位置
movProjectDir(project_dir_path);
//启动tomcat
//startTomcat(tomcat_dir_path);
progressBar.setValue(100);
// 关闭窗口
//frame.setVisible(false);//隐藏
frame.dispose(); //销毁
}