0

I know a way of adding a file extension in FileChooser in javafx:

FileChooser chooser = new FileChooser();

chooser.getExtensionFilters().add("JPG Files(*.JPG)", "*.jpg");  

But is there any way I can do this without any description argument and just care about the file extension?

Aditya Singh
  • 2,343
  • 1
  • 23
  • 42

1 Answers1

0

Its not possible, as there is no such constructor for ExtensionFilter. There are two constructors and both need a description.

You need to pass a string in place of description, though you can pass an empty string "" ;)

ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176