Пример #1
0
  public JFileChooser createFileChooser() {
    // create a filechooser
    JFileChooser fc = new JFileChooser();
    if (getSwingSet2() != null && getSwingSet2().isDragEnabled()) {
      fc.setDragEnabled(true);
    }

    // set the current directory to be the images directory
    File swingFile = new File("resources/images/About.jpg");
    if (swingFile.exists()) {
      fc.setCurrentDirectory(swingFile);
      fc.setSelectedFile(swingFile);
    }

    return fc;
  }
Пример #2
0
 public FilePreviewer(JFileChooser fc) {
   setPreferredSize(new Dimension(100, 50));
   fc.addPropertyChangeListener(this);
   setBorder(new BevelBorder(BevelBorder.LOWERED));
 }