helpdialog.java
来自「基于P2P框架的使用CMS编写的文件共享系统」· Java 代码 · 共 45 行
JAVA
45 行
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 + =
减小字号Ctrl + -
显示快捷键?