private void buttonChooseFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChooseFileActionPerformed
    final File theFile = new File(this.textFieldFilePath.getText().trim());
    final File parent = theFile.getParentFile();

    final JFileChooser chooser = new JFileChooser(parent == null ? this.projectFolder : parent);
    if (theFile.isFile()) {
      chooser.setSelectedFile(theFile);
    }
    chooser.setApproveButtonText("Select");
    chooser.setDialogTitle("Select file");
    chooser.setMultiSelectionEnabled(false);
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

    if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
      final File selected = chooser.getSelectedFile();
      this.textFieldFilePath.setText(selected.getAbsolutePath());
    }
  }
private void buttonChooseFileActionPerformed ( java . awt . event . ActionEvent evt ) { final File theFile = new File ( this . textFieldFilePath . getText ( ) . trim ( ) ) ; final File parent = theFile . getParentFile ( ) ; final JFileChooser chooser = new JFileChooser ( parent == null ? this . projectFolder : parent ) ; if ( theFile . isFile ( ) ) { chooser . setSelectedFile ( theFile ) ; } chooser . setApproveButtonText ( "Select" ) ; chooser . setDialogTitle ( "Select file" ) ; chooser . setMultiSelectionEnabled ( false ) ; chooser . setFileSelectionMode ( JFileChooser . FILES_AND_DIRECTORIES ) ; if ( chooser . showOpenDialog ( this ) == JFileChooser . APPROVE_OPTION ) { final File selected = chooser . getSelectedFile ( ) ; this . textFieldFilePath . setText ( selected . getAbsolutePath ( ) ) ; } }
GEN-LAST:event_labelBrowseCurrentLinkMouseClicked