if (serverInterface != null) { JFileChooser chooser = new JFileChooser(currentDirectory); chooser.setMultiSelectionEnabled(false); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int option = chooser.showSaveDialog(null); if (option == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); currentDirectory = chooser.getCurrentDirectory().getPath(); serverInterface.saveGame(f);
synchronized (ServerControlModel.this) { if (dialog != null) return;  if (serverInterface != null) { JFileChooser chooser = new JFileChooser(currentDirectory); chooser.setMultiSelectionEnabled(false); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int option; chooser.setDialogType(JFileChooser.SAVE_DIALOG); SaveListener listener = new SaveListener(chooser); chooser.addActionListener(listener); dialog = screenHandler.showDialog(chooser, chooser.getDialogTitle());
        public void actionPerformed(ActionEvent e) {            if (serverInterface != null) {		JFileChooser chooser = new JFileChooser(currentDirectory);		chooser.setMultiSelectionEnabled(false);		chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);		int option = chooser.showSaveDialog(null);		if (option == JFileChooser.APPROVE_OPTION) {		    File f = chooser.getSelectedFile();		    currentDirectory =			chooser.getCurrentDirectory().getPath();		    serverInterface.saveGame(f);		}            }        }