Here you can find the source of getFileChooser()
private static JFileChooser getFileChooser()
//package com.java2s; /*/*from ww w . jav a 2s .co m*/ * Copyright 2010 Ivan Bogicevic, Markus Knau?, Daniel Kulesz, Holger R?der, Matthias Wetzel * * This file is part of Jabi. * * Jabi is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Jabi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jabi. If not, see <http://www.gnu.org/licenses/>. */ import java.io.File; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; public class Main { private static JFileChooser fileChooser = null; /** * Returns a JFileChooser with the filter 'All Files' * @return JFileChooser */ private static JFileChooser getFileChooser() { if (fileChooser == null) { fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { @Override public String getDescription() { return "Alle Dateien"; } @Override public boolean accept(File f) { return true; } }); } return fileChooser; } }