I have to write on a file the data that I get from the fields that are already filled when a checkbox is checked.
Here is what I started write. (please note that I was guessing with the jChackBox1.isEnabled() I'm pretty sure that is wrong)
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
if(jCheckBox1.isEnabled()){
try {
FileOutputStream Backup = new FileOutputStream("BackupFile.txt");
PrintStream write = new PrintStream(Backup);
} catch (FileNotFoundException ex) {
Logger.getLogger(Crypto.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
I have to get the text written in this two fields
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
String pwd = String.valueOf(jPasswordField1.getPassword());
String EncryptionKey = "dhsakjh7324afe24";
AESExample aes = new AESExample(EncryptionKey);
String encpwd = aes.encrypt(pwd); //I NEED TO GET THE VALUE OF ENCPWD
jTextArea1.setText("Encryption complete.\n\n" + encpwd);
String Desc = jTextField1.getText();//AND TO GET THIS VALUE
How can I do it? I haven't found anything.