📄 jtgl_jbsj.java
字号:
import java.awt.*;
import java.awt.event.*;
public class JTGL_jbsj extends Frame implements ItemListener,ActionListener{
Choice choice;
Label label,label1;
Button ok = new Button("确定");
Button cancel = new Button("取消");
TextField Input = new TextField(15);
JTGL_jbsj(){
Label label1=new Label("请选择类型:");
add(label1);
choice=new Choice();
choice.addItem("加班时间A");
choice.addItem("加班时间B");
choice.addItemListener(this);
label=new Label();
setLabelText(choice.getSelectedIndex(),choice.getSelectedItem());
setLayout(new FlowLayout());
add(choice);
add(label);
add(Input);
Label label2=new Label("请输入正整数(输错不负责)");
add(label2);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
setVisible(false);
}
});
Panel panel3 = new Panel();
panel3.add(ok);
panel3.add(cancel);
add("South",panel3);
ok.addActionListener(this);
cancel.addActionListener(this);
setSize(300,200);
setTitle("加班时间津贴管理");
setVisible(true);
setResizable(false);
setLocationRelativeTo(null);
}
public void actionPerformed(ActionEvent e){
if (e.getActionCommand().equals("确定"))
{
System.exit(0);
}
if (e.getActionCommand().equals("取消"))
{
setVisible(false);
new JTGLXZ();
}
}
void setLabelText(int num,String text){
label.setText("请键入您要为"+text+"设定的加班津贴");
}
public void itemStateChanged(ItemEvent e){
setLabelText(choice.getSelectedIndex(),choice.getSelectedItem());
if (choice.getSelectedItem()==""){
new About();setVisible(false);}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -