我正在尝试为我的程序创建一个设置文件,但是当我调试程序时,我得到一个 IOException。
这是我正在使用的代码。
// Universal Android Toolkit
String docs = new String(System.getProperty("user.home"));
String uatDocs = docs + "/Team_M4gkBeatz/Universal_Android_Toolkit";
// Settings
File sets = new File(uatDocs + "/Settings/Settings_uat.uatsavefile");
private void createSettings()
{
try
{
jProgressBar1.setValue(0);
progress += "Creating settings file... ";
jTextArea2.setText(progress);
sets.createNewFile();
Thread.sleep(3000);
progress += "Done.\nLoading UI...\n";
jTextArea2.setText(progress);
jProgressBar1.setValue(100);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "ERROR: There was an error while creating the settings file.\n" + ex + "\nPlease report this error to the developer/s.\nThe application will now close.", "Error Creating Settings File", JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
}
我究竟做错了什么?