Thanks man! It worked. But the file dialog displayed has a different view unlike the static method of getOpenfilename(...).