public static void saveAs(ArrayList<String> lines) throws IOException {
        JFileChooser chooser = new JFileChooser();
        
        chooser.setDialogTitle("Save file as? ");
        int result = chooser.showSaveDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();
            if (file != null) {
                fileName = file.getCanonicalPath();
                writeTo(fileName, lines);
            }
        }
    }