if (serverInterface != null) { JFileChooser chooser = new JFileChooser(currentDirectory); chooser.setMultiSelectionEnabled(false); int option = chooser.showOpenDialog(null); if (option == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); if (! f.isFile()) { modelRoot.getUserMessageLogger().println("You must " + "select a valid file name"); return; } currentDirectory = chooser.getCurrentDirectory().getPath(); serverInterface.loadGame(f);
synchronized (ServerControlModel.this) { if (dialog != null) return;  if (serverInterface != null) { JFileChooser chooser = new JFileChooser(currentDirectory); chooser.setMultiSelectionEnabled(false); int option; LoadListener listener = new LoadListener(chooser); chooser.setDialogType(JFileChooser.OPEN_DIALOG); 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);		int option = chooser.showOpenDialog(null);		if (option == JFileChooser.APPROVE_OPTION) {		    File f = chooser.getSelectedFile();		    if (! f.isFile()) {			modelRoot.getUserMessageLogger().println("You must "				+ "select a valid file name");			return;		    }		    currentDirectory =			chooser.getCurrentDirectory().getPath();		    serverInterface.loadGame(f);		}            }        }