// action: voidfunc(File) static void inputFilePath(S msg, fO action) { final JTextField tfPath = jtextfield(userHome()); S title = joinStrings(" | ", msg, programName()); JComponent form = showFormTitled(title, unnull(msg), centerAndEast(tfPath, jbutton("Browse...", r { JFileChooser fileChooser = new JFileChooser(getTextTrim(tfPath)); if (fileChooser.showOpenDialog(tfPath) == JFileChooser.APPROVE_OPTION) tfPath.setText(fileChooser.getSelectedFile().getAbsolutePath()); })), r { callF(action, new File(getTextTrim(tfPath))) }); renameSubmitButton(form, "OK"); }