I'm open to using a simple FileDialog option for both print and save but I'm stuck on the proper syntax for an applet. It is the use of JApplet's Container versus a JFrame in an application. The applet has to appear within the html page.
Any help would be much appreciated.
My code for the save button activation is as follows:
ActionListener buttonHandlerS = new ActionListener() {
public void actionPerformed(ActionEvent e) {
textArea.getText();
FileWriter writer = null;
try {
textArea.getText();
writer = new FileWriter("c://matrix_small_projects.txt");
textArea.write(writer);
}
catch (IOException exception) {
System.err.println("Save not successful");
exception.printStackTrace();
}
finally {
if (writer != null)
{
try{
writer.close();
}
catch (IOException exception) {
System.err.println("Error closing writer");
exception.printStackTrace();
}
}
}
saveContent.addActionListener(buttonHandlerS);
};
};