📄 messageawake.java
字号:
package cn.com.dialog.classmanagerdialog.classintercalate;
import java.awt.Font;
import java.awt.GridBagLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import cn.com.action.classmanageraction.IntercalateAction;
import cn.com.util.GBC;
public class MessageAwake extends JDialog{
IntercalateAction action;
public MessageAwake(){
initalDialog();
}
public void initalDialog(){
this.setSize(300,150);
JPanel pane = new JPanel(new GridBagLayout());
JPanel pane1 = new JPanel();
JLabel label;
pane1.add(label = new JLabel("你真的要删除所选的科目吗?"),new GBC(1,0).setFill(GBC.BOTH));
label.setFont(new Font("华文行楷",Font.BOLD, 18));
pane.add(buildButton("是"),new GBC(0,1).setInsets(10).setFill(GBC.BOTH));
pane.add(buildButton("否"),new GBC(2,1).setInsets(10).setFill(GBC.BOTH));
this.add(pane1);
this.add(pane,"South");
this.setLocationRelativeTo(null);
this.setModal(true);
this.setVisible(true);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}
/**
* 构建有名字的按钮
*
* @param name按钮名字
* @return
*/
public JButton buildButton(String name) {
JButton button = new JButton(name);
action = new IntercalateAction(this);
button.addActionListener(action);
return button;
}
/**
* 创建带图标的按钮
*
* @param name
* @return
*/
private JButton buildButton(String name, String image) {
JButton button = new JButton(new ImageIcon(image));
button.setName(name);
action = new IntercalateAction(this);
button.addActionListener(action);
return button;
}
// public static void main(String[] args){
// new MessageAwake();
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -