0

How is it possible to allow the user only to open a specific file?

In my case I want only to allow to open the "myapplication.exe" file, which could be somewhere on my filesystem, so this is why I need the FileChooser.

I only know how to allow specific file extensions. I could only allow them to open all *.exe files, but this is too much; I only want to allow this one specific file.

I searched so much, but did not find a solution to this. I hope you could help me.

Is this possible? If yes, how?

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Opa114
  • 518
  • 4
  • 12
  • 28

1 Answers1

1

You can set any implementation of FileFilter to the file chooser, it does not have to be a FileNameExtensionFilter

lbalazscs
  • 17,474
  • 7
  • 42
  • 50