java filedialog

Solutions on MaxInterview for java filedialog by the best coders in the world

showing results for - "java filedialog"
Greta
22 Aug 2019
1FileDialog fd = new FileDialog(yourJFrame, "Choose a file", FileDialog.LOAD);
2fd.setDirectory("C:\\");
3fd.setFile("*.xml");
4fd.setVisible(true);
5String filename = fd.getFile();
6if (filename == null)
7    System.out.println("You cancelled the choice");
8else
9    System.out.println("You chose " + filename);