📄 filedialogdemo.java.bak
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class FileDialogDemo extends Frame
{
private JPanel contentPane;
private XYLayout xYLayout1 = new XYLayout();
private Button button1 = new Button("显示文件对话框");
private FileDialog d=new FileDialog(this,"打开文件");
//Construct the frame
public FileDialogDemo() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(400, 300));
this.setTitle("Frame Title");
button1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button1_actionPerformed(e);
}
});
contentPane.add(button1, new XYConstraints(114, 73, 125, 35));
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void button1_actionPerformed(ActionEvent e) {
d.show();
}
public static void main(String args[]){
FileDialogDemo f=new FileDialogDemo();
f.show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -