inProfile.setVisible(true);
if(inProfile.getResult()==null)
return;
Profile prfMain=new Profile(inProfile.getResult());
inProfile=null;
FileWriter fwDBWriter;
if(!fdCreate.getSelectedFile().exists())
{
if((!fdCreate.getSelectedFile().getName().toLowerCase().endsWith(".vcd"))&&(!(new File(fdCreate.getSelectedFile().getName()+".vcd")).exists()))
fwDBWriter=new FileWriter(fdCreate.getSelectedFile()+".vcd", prfMain);
else
fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
}
else
{
YesNoCancelMessage ynmDelete=new YesNoCancelMessage(mwcMain, mwcMain.getTitle(), "The file already exists would you like to replace it?", false);
ynmDelete.setVisible(true);
if(ynmDelete.getResult()==YesNoCancelMessage.NO)
{
ynmDelete=null;
fdCreate=null;
return;
}
fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
}
if(!fwDBWriter.write(pcPass.getPassword()))
{
OKMessage okError=new OKMessage(mwcMain, "The error occured while writing the file!");
okError.setVisible(true);
okError=null;
}