⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filedialogexample.java

📁 Java程序设计清华出版课件源码答案共十四章
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;

public class FileDialogExample
		implements ActionListener{
	Frame f;
	Button b;
	TextArea ta;
	FileDialog fd;

	static public void main(String args[]) {
		FileDialogExample fde = new FileDialogExample();
		fde.go();
}

public void go() {
f = new Frame("FileDialog Example");
b = new Button("Show FileDialog");
b.addActionListener(this);
f.add("South",b);

ta = new TextArea();
f.add("Center",ta);

fd = new FileDialog(f,"FileDialog");

f.setSize(350,150);
f.setVisible(true);
}

public void actionPerformed(ActionEvent e) {
fd.setVisible(true);
ta.setText("Directory :"+fd.getDirectory());
ta.append("\nFilename :"+fd.getFile());
}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -