📜  java filedialog - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:20.085000             🧑  作者: Mango

代码示例1
FileDialog fd = new FileDialog(yourJFrame, "Choose a file", FileDialog.LOAD);
fd.setDirectory("C:\\");
fd.setFile("*.xml");
fd.setVisible(true);
String filename = fd.getFile();
if (filename == null)
    System.out.println("You cancelled the choice");
else
    System.out.println("You chose " + filename);