/** Called when the user pressed the enter button. */ @Override public void enterPressed() { String file = null; file = fileChooser.getFileName(); fileChooser.setCurrentFileName(file); if (!(file == null)) { notifyListeners(file); } setVisible(false); }
/** Implementing the action of pressing the ok button. */ public void okButton_actionPerformed() { String file = null; file = fileChooser.getFileName(); fileChooser.setCurrentFileName(file); setVisible(false); if (!(file == null)) { notifyListeners(file); } }
/** Sets the file name (which is written inside the text field). */ public void setFileName(String name) { fileChooser.setCurrentFileName(name); fileChooser.showCurrentFileName(); }