SWT Filedialog Open into home folder
- by Ivan
I want to open a FileDialog window into the user home folder (i.e. /home/user or /Users/unsername)
I read the user home folder, using System.getProperty:
String homefolder = System.getProperty(user.home);
And the variable containts the correct home folder. But when i set the filterpath in FileDialog, it opens (in linux) only the /home level not entering into the user home dir.
This is the source code:
FileDialog dialog = new FileDialog(shell);
dialog.setText("Choose a certificate");
String platform = SWT.getPlatform();
String homefolder = System.getProperty("user.home");
dialog.setFilterPath(homefolder);
Any idea?
Here a screenshot: