jeremytaffy
Technical User
I tried the following lines of code to print the information from text field to a file at the press of a button called "start":
start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
FileOutputStream file =
new FileOutputStream("/home/smash/test"
;
ObjectOutputStream out =
new ObjectOutputStream(file);
out.WriteObject(row1);
} catch (java.io.IOException e) {
System.out.println("Cannot access file"
;
}
}
});
//row1 is the panel name to which the jtextfield is added.
I keep getting the error that e is already defined in actionPerformed(java.awt.event.ActionEvent) ....
Please let me know how to fix this problem or any more appropriate ways of getting this to work.
Thanks in advance.
start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
FileOutputStream file =
new FileOutputStream("/home/smash/test"
ObjectOutputStream out =
new ObjectOutputStream(file);
out.WriteObject(row1);
} catch (java.io.IOException e) {
System.out.println("Cannot access file"
}
}
});
//row1 is the panel name to which the jtextfield is added.
I keep getting the error that e is already defined in actionPerformed(java.awt.event.ActionEvent) ....
Please let me know how to fix this problem or any more appropriate ways of getting this to work.
Thanks in advance.