Refine search
@Override public void actionPerformed(final ActionEvent e) { final JFileChooser jfc = new JFileChooser(); jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); jfc.setAcceptAllFileFilterUsed(false); final int result = jfc.showSaveDialog(null); if (result == JFileChooser.APPROVE_OPTION) { txtTempFolder.setText(jfc.getSelectedFile().getAbsolutePath()); } } });
@Override public void actionPerformed(final ActionEvent e) { final JFileChooser jfc = new JFileChooser(); jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); jfc.setAcceptAllFileFilterUsed(true); final int result = jfc.showSaveDialog(null); if (result == JFileChooser.APPROVE_OPTION) { final String absolutePath = jfc.getSelectedFile().getAbsolutePath(); if (absolutePath.endsWith(".zip")) { txtDestination.setText(absolutePath); } else { txtDestination.setText(absolutePath + ".zip"); } } } });
public void openFile() { JFileChooser fileChooser = new JFileChooser(); fileChooser.setAcceptAllFileFilterUsed(true); String[] exts = {"apk", "dex", "jar", "class", "zip", "aar", "arsc"}; String description = "supported files: " + Arrays.toString(exts).replace('[', '(').replace(']', ')'); fileChooser.setFileFilter(new FileNameExtensionFilter(description, exts)); fileChooser.setToolTipText(NLS.str("file.open_action")); String currentDirectory = settings.getLastOpenFilePath(); if (!currentDirectory.isEmpty()) { fileChooser.setCurrentDirectory(new File(currentDirectory)); } int ret = fileChooser.showDialog(mainPanel, NLS.str("file.open_title")); if (ret == JFileChooser.APPROVE_OPTION) { settings.setLastOpenFilePath(fileChooser.getCurrentDirectory().getPath()); openFile(fileChooser.getSelectedFile()); } }
private void displayDialogChangeDir() { final JFileChooser chooser = new JFileChooser(); chooser.setDialogType(JFileChooser.CUSTOM_DIALOG); chooser.setDialogTitle("Directory to watch:"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); final String currentPath = prefs.get(KEY_DIR, "."); chooser.setCurrentDirectory(new File(currentPath)); Log.info("Showing OpenDialog"); final int returnVal = chooser.showOpenDialog(this); Log.info("Closing OpenDialog"); if (returnVal == JFileChooser.APPROVE_OPTION) { final File dir = chooser.getSelectedFile(); changeDir(dir); } }
public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); fc.setDialogTitle("Select a Java installation directory..."); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setAcceptAllFileFilterUsed(false); Preferences p = Preferences.userNodeForPackage(Installer.class); final String prefID = "defaultDirectory"; fc.setCurrentDirectory(new File(p.get(prefID, "."))); if (fc.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) { Path dir = fc.getSelectedFile().toPath(); p.put(prefID, dir.getParent().toString()); try { installations.add(new Installation(config, dir)); } catch (IOException ex) { MainWindow.showInstallerException(ex, parent); } } } }
chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle(choosertitle); chooser.setAcceptAllFileFilterUsed(false);
private void btnOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenActionPerformed JFileChooser chooser = new JFileChooser(); chooser.setAcceptAllFileFilterUsed(true); chooser.setDialogTitle("Select OGG file"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle("choosertitle"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory()); System.out.println("getSelectedFile() : " + chooser.getSelectedFile()); } else { System.out.println("No Selection "); }
public static JFileChooser getSettingsFileChooser() { FirmwareSettingsFileTypeFilter filter = new FirmwareSettingsFileTypeFilter(); // Setup file browser with the last path used. JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setFileHidingEnabled(true); fileChooser.addChoosableFileFilter(filter); fileChooser.setAcceptAllFileFilterUsed(true); fileChooser.setFileFilter(filter); return fileChooser; }
public static JFileChooser getGcodeFileChooser(String startDir) { //Setup the file filter for gcode files. GcodeFileTypeFilter filter = new GcodeFileTypeFilter(); // Setup file browser with the last path used. JFileChooser fileChooser = new JFileChooser(startDir); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setFileHidingEnabled(true); fileChooser.addChoosableFileFilter(filter); fileChooser.setAcceptAllFileFilterUsed(true); fileChooser.setFileFilter(filter); return fileChooser; }
protected String playerLoadDeck() { if (fcSelectDeck == null) { fcSelectDeck = new JFileChooser(); fcSelectDeck.setAcceptAllFileFilterUsed(false); fcSelectDeck.addChoosableFileFilter(new DeckFilter()); } String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", ""); if (!lastFolder.isEmpty()) { fcSelectDeck.setCurrentDirectory(new File(lastFolder)); } int ret = fcSelectDeck.showDialog(this, "Select Deck"); if (ret == JFileChooser.APPROVE_OPTION) { File file = fcSelectDeck.getSelectedFile(); return (file.getPath()); } return ""; }
JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setFileFilter( fileChooser.setAcceptAllFileFilterUsed(false); fileChooser.setDialogTitle("Export");
/** * Creates new form NewPlayerPanel */ public NewPlayerPanel() { initComponents(); fcSelectDeck = new JFileChooser(); fcSelectDeck.setAcceptAllFileFilterUsed(false); fcSelectDeck.addChoosableFileFilter(new DeckFilter()); String deckPath = MageFrame.getPreferences().get("defaultDeckPath", ""); if (deckPath.isEmpty()) { if (Config.defaultDeckPath != null) { deckPath = Config.defaultDeckPath; } } this.txtPlayerDeck.setText(deckPath); if (Config.defaultComputerName != null) { this.txtPlayerName.setText(Config.defaultComputerName); } }
File fileChoosen = null; while (true) { fchooser = new JFileChooser(); if (SX.isMac()) { fchooser.putClientProperty("JFileChooser.packageIsTraversable", "always"); fchooser.setAcceptAllFileFilterUsed(true); } else { fchooser.setAcceptAllFileFilterUsed(false); for (Object filter : filters) { if (filter instanceof SikulixFileFilter) {
fcSelectDeck = new JFileChooser(); fcSelectDeck.setAcceptAllFileFilterUsed(false); fcSelectDeck.addChoosableFileFilter(new DeckFilter()); fcImportDeck = new JFileChooser(); fcImportDeck.setAcceptAllFileFilterUsed(false); fcImportDeck.addChoosableFileFilter(new ImportFilter());
JFileChooser fileChooser = new JFileChooser(); FileFilter pngFileFilter = new SuffixSaveFilter("png"); // default fileChooser.addChoosableFileFilter(pngFileFilter); fileChooser.setAcceptAllFileFilterUsed(false);
JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle("select folder"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false);
JFileChooser chooser = new JFileChooser() { // put in all the routines as listed earlier }; chooser.setAcceptAllFileFilterUsed(true); int choice = chooser.showOpenDialog(null); if (choice == JFileChooser.APPROVE_OPTION) { String name = chooser.getSelectedFile().getAbsolutePath(); System.out.println(name); }
private void directoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_directoryButtonActionPerformed // Select save directory JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Directory Select"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { folderField.setText(chooser.getSelectedFile().getAbsolutePath() + File.separator); } }//GEN-LAST:event_directoryButtonActionPerformed
JFileChooser fileDialog = new JFileChooser(); fileDialog.setAcceptAllFileFilterUsed(false); int returnVal = fileDialog.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileDialog.getSelectedFile(); if(file.getName().endsWith(".battle")){ System.out.println("Selected file is battle file"); }else{ System.out.println("Invalied file type"); } }