import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
public class FileDialogFilterExtensions {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
FileDialog dialog = new FileDialog(shell);
dialog.setFilterExtensions(new String[] { "*.ico", "*.gif", "*.*" });
String name = dialog.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
|