This section illustrates you how to browse a file.
In SWT, the class FileDialog allow the user to navigate the file
system and select a file name. In order to layout the text, we have used the
method text.setLayoutData(data). The method file.isFile()
tests whether the file denoted by the pathname is a normal file. The method file.list()
returns an array of files and directories. The method text.setText(files[i])
sets the selected file in the text. The method text.setEditable(true)
sets the editable state.
November 18, 2011
FileDialog can let you select files only
A fileDialog will not return unless you select file/files.
If you select a directory and click Open,then it just takes you inside the directory. Hence the code
is Unreachable in above example