📄 helpdialog.java
字号:
import java.awt.*;
import java.awt.event.*;
import java.awt.Dialog;
public class HelpDialog extends Dialog implements ActionListener
{
Button sure;
Label label;
public HelpDialog(Frame owner,String title,boolean modal)
{
super(owner,title,modal);
setLayout(null);
setResizable(false);
setBounds(100,80,400,300);
sure=new Button("确定");
label=new Label();
sure.setBounds(320,260,50,20);
label.setBounds(20,45,250,200);
label.setBackground(Color.pink);
add(sure);
add(label);
sure.addActionListener(this);
addWindowListener(
new WindowAdapter(){ //事件适配器(Adapter)类
public void windowClosing(WindowEvent e)
{
dispose();
}
});
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==sure)
{
dispose();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -