Examples of showOpenDialog()


Examples of javax.swing.JFileChooser.showOpenDialog()

                String path = f.getAbsolutePath();
                if (path != null && !"".equals(path)) {
                    chooser.setCurrentDirectory(new File(path));
                }
            }
      int returnVal = chooser.showOpenDialog(this);
      if(returnVal == JFileChooser.APPROVE_OPTION) {
        //  System.out.println("You chose to open this file: " +
        //    chooser.getSelectedFile().getName());
        try {
          fileNameField.setText(chooser.getSelectedFile().getCanonicalPath());
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

                fd.setDialogTitle( DemoApp.getRes().getString( "Select Executable for customization" ) );
                fd.setFileHidingEnabled( true );
                fd.setApproveButtonText( DemoApp.getRes().getString( "Load Executable" ) );
                FileFilter filter = new ExtensionFilter( DemoApp.getRes().getString( "Wrapper Executable (*.exe)" ), new String[] { "exe" } );
                fd.setFileFilter( filter );
                int returnVal = fd.showOpenDialog( CustomizeDialog.this );

                if ( returnVal == JFileChooser.APPROVE_OPTION )
                {
                    try
                    {
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

                fd.setDialogTitle( DemoApp.getRes().getString( "Select Icon for customization" ) );
                fd.setFileHidingEnabled( true );
                fd.setApproveButtonText( DemoApp.getRes().getString( "Load Icon" ) );
                FileFilter filter = new ExtensionFilter( DemoApp.getRes().getString( "Icon File (*.ico)" ), new String[] { "ico" } );
                fd.setFileFilter( filter );
                int returnVal = fd.showOpenDialog( CustomizeDialog.this );

                if ( returnVal == JFileChooser.APPROVE_OPTION )
                {
                    try
                    {
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

                fd.setDialogTitle( DemoApp.getRes().getString( "Select splash screen for customization" ) );
                fd.setFileHidingEnabled( true );
                fd.setApproveButtonText( DemoApp.getRes().getString( "Load splash screen" ) );
                FileFilter filter = new ExtensionFilter( DemoApp.getRes().getString( "Splash screen File (*.bmp)" ), new String[] { "bmp" } );
                fd.setFileFilter( filter );
                int returnVal = fd.showOpenDialog( CustomizeDialog.this );

                if ( returnVal == JFileChooser.APPROVE_OPTION )
                {
                    try
                    {
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

            }

            public void actionPerformed(ActionEvent e) {
                JFileChooser fc = ImportFormats.createImportFileChooser
                        (Globals.prefs.get("importWorkingDirectory"));
                fc.showOpenDialog(frame);
                File file = fc.getSelectedFile();
                if (file == null)
                    return;
                FileFilter ff = fc.getFileFilter();
                ImportFormat format = null;
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

            }

            public void actionPerformed(ActionEvent e) {
                JFileChooser fc = ImportFormats.createImportFileChooser
                        (Globals.prefs.get("importWorkingDirectory"));
                fc.showOpenDialog(frame);
                File file = fc.getSelectedFile();
                if (file == null)
                    return;
                FileFilter ff = fc.getFileFilter();
                ImportFormat format = null;
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

  }//GEN-LAST:event_quitMenuAction


  private void loadMenuAction(java.awt.event.ActionEvent evt) {
    JFileChooser chooser = new JFileChooser();
    int returnVal = chooser.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
      try {
        memoFromFile(chooser.getSelectedFile());
      }
      catch (Exception e) { showException(this,e); }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

        // BROWSE_BUTTON
        browseDestButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.PDF_FILE,
                        JFileChooser.FILES_ONLY, destinationTextField.getText());
                if (fileChooser.showOpenDialog(browseDestButton.getParent()) == JFileChooser.APPROVE_OPTION) {
                    File chosenFile = fileChooser.getSelectedFile();
                    if (chosenFile != null) {
                        destinationTextField.setText(chosenFile.getAbsolutePath());
                    }
                }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

            JFileChooser chooser = new JFileChooser(new File("."));
            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            chooser.setMultiSelectionEnabled(true);
            chooser.setDialogTitle("Choose File to Compile");
            chooser.setFileFilter(chooserFileFilter);
            if(chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {              
                File[] flist = chooser.getSelectedFiles();
                if (flist != null && flist.length != 0){
                    try {
                        for (int i=0; i<flist.length; i++){
                            File f = flist[i].getCanonicalFile();
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

        fileChooser.setFileHidingEnabled(true);
        fileChooser.setDialogType(JFileChooser.OPEN_DIALOG);
        // TODO Language
        fileChooser.setDialogTitle("Choose directory");
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int selection = fileChooser.showOpenDialog(parent);
        if (selection == JFileChooser.APPROVE_OPTION) {
            result = fileChooser.getSelectedFile();
        }
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.