javax.swing.JFileChooser.setControlButtonsAreShown()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中javax.swing.JFileChooser.setControlButtonsAreShown()方法的一些代码示例,展示了JFileChooser.setControlButtonsAreShown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.setControlButtonsAreShown()方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:setControlButtonsAreShown

JFileChooser.setControlButtonsAreShown介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

JFileChooser.FILES_AND_DIRECTORIES);
chooser.setFileHidingEnabled(fileHiding);
chooser.setControlButtonsAreShown(controlButtonsShown);
chooser.setAcceptAllFileFilterUsed(useAcceptAllFileFilter);
if (title != null) {

代码示例来源:origin: stackoverflow.com

import java.io.File;
import javax.swing.JFileChooser;

public class ShowDirectoriesOnly {
  public static void main(String[] args) {
   JFileChooser fileChooser = new JFileChooser( "." );
   fileChooser.setControlButtonsAreShown( false );
   fileChooser.setFileFilter( new FolderFilter() );
   fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
   fileChooser.showOpenDialog(null);
  }

  private static class FolderFilter extends javax.swing.filechooser.FileFilter {
   @Override
   public boolean accept( File file ) {
    return file.isDirectory();
   }

   @Override
   public String getDescription() {
    return "We only take directories";
   }
  }
}

代码示例来源:origin: nroduit/Weasis

public static String openDirectoryChooser(String path) {
  JFileChooser fc = new JFileChooser(path);
  fc.setDialogType(JFileChooser.OPEN_DIALOG);
  fc.setControlButtonsAreShown(true);
  fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  int returnVal = fc.showOpenDialog(null);
  String returnStr = null;
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    try {
      returnStr = fc.getSelectedFile().toString();
    } catch (SecurityException e) {
      LOGGER.warn("system property value cannot be accessed", e); //$NON-NLS-1$
    }
  }
  return returnStr;
}

代码示例来源:origin: orbisgis/orbisgis

/**
 * This method returns the FileChooser attached to this. It creates a new one
 * if the FileChooser has not been instanciated before.
 * @return
 */
public JFileChooser getFileChooser() {
  if (fileChooser == null) {
    fileChooser = new JFileChooser();
    fileChooser.setControlButtonsAreShown(false);
    fileChooser.setMultiSelectionEnabled(true);
    if(showFoldersOnly()){
      fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    }
  }
  return fileChooser;
}
  /**

代码示例来源:origin: nroduit/Weasis

public static String openDirectoryChooser(String path, Component parent) {

    JFileChooser fc = new JFileChooser(path);
    fc.setDialogType(JFileChooser.OPEN_DIALOG);
    fc.setControlButtonsAreShown(true);
    fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    int returnVal = fc.showOpenDialog(parent);
    String returnStr = null;

    if (returnVal == JFileChooser.APPROVE_OPTION) {
      try {
        returnStr = fc.getSelectedFile().toString();
      } catch (SecurityException e) {
        LOGGER.warn("directory cannot be accessed", e); //$NON-NLS-1$
      }
    }
    return returnStr;
  }
}

代码示例来源:origin: stackoverflow.com

fileChooser.setControlButtonsAreShown(false);
fileChooser.setControlButtonsAreShown(true);

代码示例来源:origin: nroduit/Weasis

fc.setControlButtonsAreShown(true);
fc.setAcceptAllFileFilterUsed(true);
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-swingapp

fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChooser.setAcceptAllFileFilterUsed(true);
fileChooser.setControlButtonsAreShown(true);
fileChooser.setMultiSelectionEnabled(false);
fileChooser.setFileFilter(new javax.swing.filechooser.FileFilter() {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private JFileChooser createDirPanel(String seed, final PropertyEditorSupport editor, PropertyEnv propenv) {
  String titleText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("Run_Directory");
  String buttonText = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/makeproject/api/Bundle").getString("SelectLabel");
  final JFileChooser chooser = RemoteFileUtil.createFileChooser(getSourceExecutionEnvironment(), titleText, buttonText,
      JFileChooser.DIRECTORIES_ONLY, null, seed, true);
  chooser.putClientProperty("title", chooser.getDialogTitle()); // NOI18N
  chooser.setControlButtonsAreShown(false);
  propenv.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
  propenv.addPropertyChangeListener(new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) && evt.getNewValue() == PropertyEnv.STATE_VALID) {
        File selectedFile= chooser.getSelectedFile();
        String path = CndPathUtilities.toRelativePath(makeConfiguration.getBaseDir(), selectedFile.getPath()); // FIXUP: not always relative path
        path = CndPathUtilities.normalizeSlashes(path);
        editor.setValue(path);
      }
    }
  });
  return chooser;
}

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

public IFileChooserPanel create(final IOpenFileChooserConfiguration configuration) {
 final JFileChooser fileChooser = FileChoosers.createOpenFileChooser(this.preferences, configuration);
 fileChooser.setControlButtonsAreShown(false);
 if (configuration.isMultiSelectionEnabled()) {
  return new MultiFileChooserPanel(fileChooser, this.preferences);
 }
 return new SingleFileChooserPanel(fileChooser, this.preferences);
}

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

public IFileChooserPanel create(final ISaveFileChooserConfiguration configuration) {
  final JFileChooser fileChooser = FileChoosers.createSaveFileChooser(this.preferences, configuration);
  fileChooser.setControlButtonsAreShown(false);
  if (configuration.isMultiSelectionEnabled()) {
   return new MultiFileChooserPanel(fileChooser, this.preferences);
  }
  return new SingleFileChooserPanel(fileChooser, this.preferences);
 }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

chooser.setControlButtonsAreShown(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

chooser.setControlButtonsAreShown(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-propertyeditors

filePanel.setControlButtonsAreShown(false);
filePanel.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

projectChooser.setControlButtonsAreShown(false);
jarFileChooser.setControlButtonsAreShown(false);
jarFileChooser.setMultiSelectionEnabled(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-propertyeditors

filePanel.setControlButtonsAreShown(false);
filePanel.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  gui_choose = new javax.swing.JFileChooser();
  gui_choose.setControlButtonsAreShown(false);
  org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(gui_choose, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 470, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(gui_choose, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 236, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: org.xworker/xworker_core

comp.setControlButtonsAreShown(controlButtonsAreShown);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

this.baseDir = baseDir;
fileChooser.setControlButtonsAreShown(false);
  setLayout(new BorderLayout());
  add(fileChooser, BorderLayout.CENTER);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

new ElfChooserInitializer(execEnv, pathMap, seed, filters, latch),
    true);
chooser.setControlButtonsAreShown(false);
chooser.putClientProperty("title", chooser.getDialogTitle()); // NOI18N
setElfFilters(chooser, filters, latch);

相关文章

JFileChooser类方法