Q:

How to select all files in a FileDialog? 

I want to select all files to exclude them from being displayed in my FileDialog. 
        FileDialog fileDialog = new FileDialog(this, "Some Title", FileDialog. LOAD);
    fileDialog.setFilenameFilter(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
            if(name.endsWith(".*")) { 
                return false;
            }else {
                return true;
            }
        }
    });
    fileDialog.setVisible(true);

In my code you can see, that I am trying to to that with the String ".*",  to select all files.  This doesn't work however and I don't know why. 
I only want to show directories. 
Thanks for your help! 

A:

As previously stated, I found the answer to this question with the help of @JigarJoshi. 
This is the working code to show ONLY Directories on a AWT FileDialog:
fileDialog.setFilenameFilter(new FilenameFilter() {
    @Override
    public boolean accept(File dir, String name) {
        return dir.isFile();
    }
});

Please note that using FileDialog over JFileChooser is only recommendet, if you are on a non-Windows system.  However on Mac and Linux, you should prefer to use FileDialog since it looks more native. 
Thank you very much for your input!