📄 errorport.java
字号:
import java.awt.*;
public class errorPort extends Dialog {
Button OK;
Label msg;
Panel p;
public errorPort(Frame parent,String title) {
super(parent,title,true);
setBackground(Color.yellow);
setLayout(new BorderLayout(15,15));
OK=new Button("OK");
OK.setFont(new Font("Dialog",Font.BOLD,10));
p=new Panel();
p.setLayout(new FlowLayout(FlowLayout.CENTER));
p.add(OK);
msg=new Label(" ",Label.CENTER);
msg.setFont(new Font("Dialog",Font.BOLD,14));
add("Center",msg);
add("South",p);
}
public boolean handleEvent(Event event) {
if (event.id == Event.ACTION_EVENT && event.target == OK) {
clickedOK();
return true;
}
else
if (event.id == Event.WINDOW_DESTROY) {
hide();
return true;
}
return super.handleEvent(event);
}
public void clickedOK() {
hide();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -