private File lastFile = null;
public void actionPerformed(ActionEvent event) {
Object src = event.getSource();
if (src == open) {
JFileChooser chooser = JFileChoosers.createSelected(lastFile);
chooser.setDialogTitle(Strings.get("openButton"));
int choice = chooser.showOpenDialog(HexFrame.this);
if (choice == JFileChooser.APPROVE_OPTION) {
File f = chooser.getSelectedFile();
try {
HexFile.open(model, f);
lastFile = f;
} catch (IOException e) {
JOptionPane.showMessageDialog(HexFrame.this, e.getMessage(),
Strings.get("hexOpenErrorTitle"), JOptionPane.ERROR_MESSAGE);
}
}
} else if (src == save) {
JFileChooser chooser = JFileChoosers.createSelected(lastFile);
chooser.setDialogTitle(Strings.get("saveButton"));
int choice = chooser.showSaveDialog(HexFrame.this);
if (choice == JFileChooser.APPROVE_OPTION) {
File f = chooser.getSelectedFile();
try {
HexFile.save(f, model);
lastFile = f;
} catch (IOException e) {
JOptionPane.showMessageDialog(HexFrame.this, e.getMessage(),