Opening file with FileDialog not working... [message #492051] |
Sat, 17 October 2009 13:39  |
Eclipse User |
|
|
|
Hi there,
a created a XML file from a model created with GMF. Everything works fine, the file exists after generation.
I used the following code to show a FileDialog in order to allow to the user to open the XML-file which has recently being created:
Shell shell = new Shell();
String[] filterExt = {"*.xml"};
FileDialog fd = new FileDialog(shell, SWT.OPEN);
fd.setText("Open");
fd.setFilterExtensions(filterExt);
fd.setFilterPath(file.getAbsolutePath());
fd.setFileName(fileName);
String fil = fd.open();
The FileDialog actually pops up. However, when I select the XML-file and press the open button, the file does not show up, for instance in the windows editor. Surprisingly, when I use the open function of the context menu, it works fine...
Since I prefer to use the open button, I would be very pleased if anyone could help me with this issue...
Thanks, Scholle
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08490 seconds