List of usage examples for javax.swing JFileChooser setDialogTitle
@BeanProperty(preferred = true, description = "The title of the JFileChooser dialog window.") public void setDialogTitle(String dialogTitle)
JFileChooser
window's title bar. From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPkcs8.java
private void privateKeyBrowsePressed() { JFileChooser chooser = FileChooserFactory.getPkcs8FileChooser(); File currentFile = new File(jtfPrivateKeyPath.getText()); if ((currentFile.getParentFile() != null) && (currentFile.getParentFile().exists())) { chooser.setCurrentDirectory(currentFile.getParentFile()); } else {//from w ww.j av a2 s . c o m chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DImportKeyPairPkcs8.ChoosePrivateKey.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DImportKeyPairPkcs8.PrivateKeyFileChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfPrivateKeyPath.setText(chosenFile.toString()); jtfPrivateKeyPath.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPkcs8.java
private void certificateBrowsePressed() { JFileChooser chooser = FileChooserFactory.getCertFileChooser(); File currentFile = new File(jtfCertificatePath.getText()); if ((currentFile.getParentFile() != null) && (currentFile.getParentFile().exists())) { chooser.setCurrentDirectory(currentFile.getParentFile()); } else {/* www .j av a 2 s. c om*/ chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DImportKeyPairPkcs8.ChooseCertificate.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DImportKeyPairPkcs8.CertificateFileChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfCertificatePath.setText(chosenFile.toString()); jtfCertificatePath.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPvk.java
private void privateKeyBrowsePressed() { JFileChooser chooser = FileChooserFactory.getPvkFileChooser(); File currentFile = new File(jtfPrivateKeyPath.getText()); if ((currentFile.getParentFile() != null) && (currentFile.getParentFile().exists())) { chooser.setCurrentDirectory(currentFile.getParentFile()); } else {//from w w w . j a va 2 s . co m chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DImportKeyPairPvk.ChoosePrivateKey.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DImportKeyPairPvk.PrivateKeyFileChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfPrivateKeyPath.setText(chosenFile.toString()); jtfPrivateKeyPath.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.importexport.DImportKeyPairPvk.java
private void certificateBrowsePressed() { JFileChooser chooser = FileChooserFactory.getCertFileChooser(); File currentFile = new File(jtfCertificatePath.getText()); if ((currentFile.getParentFile() != null) && (currentFile.getParentFile().exists())) { chooser.setCurrentDirectory(currentFile.getParentFile()); } else {//from ww w . j av a 2s. c o m chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DImportKeyPairPvk.ChooseCertificate.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DImportKeyPairPvk.CertificateFileChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfCertificatePath.setText(chosenFile.toString()); jtfCertificatePath.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.sign.DSignJar.java
private void inputJarBrowsePressed() { JFileChooser chooser = FileChooserFactory.getArchiveFileChooser(); File currentFile = new File(jtfInputJar.getText().trim()); if (currentFile.getParentFile() != null && currentFile.getParentFile().exists()) { chooser.setCurrentDirectory(currentFile.getParentFile()); chooser.setSelectedFile(currentFile); } else {// ww w . j av a2 s . com chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DSignJar.ChooseInputJar.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DSignJar.InputJarChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfInputJar.setText(chosenFile.toString()); jtfInputJar.setCaretPosition(0); populateOutputJarFileName(chosenFile); } }
From source file:org.kse.gui.dialogs.sign.DSignJar.java
private void outputJarBrowsePressed() { JFileChooser chooser = FileChooserFactory.getArchiveFileChooser(); File currentFile = new File(jtfOutputJar.getText()); if (currentFile.getParentFile() != null && currentFile.getParentFile().exists()) { chooser.setCurrentDirectory(currentFile.getParentFile()); chooser.setSelectedFile(currentFile); } else {// ww w.j av a2s . c o m chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DSignJar.ChooseOutputJar.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = JavaFXFileChooser.isFxAvailable() ? chooser.showSaveDialog(this) : chooser.showDialog(this, res.getString("DSignJar.OutputJarChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfOutputJar.setText(chosenFile.toString()); jtfOutputJar.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.sign.DSignMidlet.java
private void inputJadBrowsePressed() { JFileChooser chooser = FileChooserFactory.getJadFileChooser(); File currentFile = new File(jtfInputJad.getText()); if (currentFile.getParentFile() != null && currentFile.getParentFile().exists()) { chooser.setCurrentDirectory(currentFile.getParentFile()); chooser.setSelectedFile(currentFile); } else {//from w w w.j a va 2 s . com chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DSignMidlet.ChooseInputJad.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DSignMidlet.InputJadChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfInputJad.setText(chosenFile.toString()); jtfInputJad.setCaretPosition(0); populateOutputJadFileName(chosenFile); } }
From source file:org.kse.gui.dialogs.sign.DSignMidlet.java
private void outputJadBrowsePressed() { JFileChooser chooser = FileChooserFactory.getJadFileChooser(); File currentFile = new File(jtfOutputJad.getText()); if (currentFile.getParentFile() != null && currentFile.getParentFile().exists()) { chooser.setCurrentDirectory(currentFile.getParentFile()); chooser.setSelectedFile(currentFile); } else {/*from ww w.j a v a 2s . co m*/ chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DSignMidlet.ChooseOutputJad.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = JavaFXFileChooser.isFxAvailable() ? chooser.showSaveDialog(this) : chooser.showDialog(this, res.getString("DSignMidlet.OutputJadChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfOutputJad.setText(chosenFile.toString()); jtfOutputJad.setCaretPosition(0); } }
From source file:org.kse.gui.dialogs.sign.DSignMidlet.java
private void jarBrowsePressed() { JFileChooser chooser = FileChooserFactory.getArchiveFileChooser(); File currentFile = new File(jtfJar.getText()); if (currentFile.getParentFile() != null && currentFile.getParentFile().exists()) { chooser.setCurrentDirectory(currentFile.getParentFile()); } else {/*w w w . j a v a 2s .co m*/ chooser.setCurrentDirectory(CurrentDirectory.get()); } chooser.setDialogTitle(res.getString("DSignMidlet.ChooseJar.Title")); chooser.setMultiSelectionEnabled(false); int rtnValue = chooser.showDialog(this, res.getString("DSignMidlet.JarChooser.button")); if (rtnValue == JFileChooser.APPROVE_OPTION) { File chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); jtfJar.setText(chosenFile.toString()); jtfJar.setCaretPosition(0); } }
From source file:org.mbari.aved.ui.utils.VideoUtils.java
/** * Browse for video clip, or still image archive starting in last imported directory *//*w ww . j a v a2s. c o m*/ public static File browseForImageSource(File setCurrentDirectory) throws Exception { File f = null; // Add a custom file filter and disable the default JFileChooser chooser = new JFileChooser(); chooser.addChoosableFileFilter(new ImageFileFilter()); chooser.setAcceptAllFileFilterUsed(false); chooser.setDialogTitle("Choose Still Image/Video Source File"); chooser.setCurrentDirectory(setCurrentDirectory); if (chooser.showOpenDialog(Application.getView()) == JFileChooser.APPROVE_OPTION) { f = chooser.getSelectedFile(); UserPreferences.getModel().setImportVideoDir(f.getParent()); } else { // TODO: print dialog message box with something meaningful here System.out.println("No Selection "); return null; } return f; }