📄 modifymsg.java
字号:
//床位管理 修改床位信息
package src;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class modifyMsg extends JFrame implements ActionListener{
private JPanel jp,jp11,jp12;
private JPanel jp1,jp2,jp3,jp4,jp5,jp6,jp7,jp121;
private JTextField name,sex2,age,birthday,inday,ZD,bedNo,doctor;
private JButton enter,mod1,mod2,mod3,mod4,mod5,mod6,mod7,mod8;
public modifyMsg(String word){
JOptionPane.showMessageDialog(bedManage.fm,word,"提示信息",JOptionPane.INFORMATION_MESSAGE);
}
public void addIn(String NUMBER){
setTitle("加床");
setSize(400,230);
setLocation(250,300);
//modify title image
ImageIcon title=new ImageIcon("images/72.gif");
setIconImage(title.getImage());
jp=new JPanel(new GridLayout(1,2));
jp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("信息"),
BorderFactory.createEmptyBorder(0,0,0,10)));
jp11=new JPanel(new GridLayout(7,1));
jp1=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp2=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp3=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp4=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp5=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp6=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp7=new JPanel(new FlowLayout(FlowLayout.LEADING));
name=new JTextField(10);
age=new JTextField(10);
doctor=new JTextField(10);
jp1.add(new JLabel("姓 名"));
jp1.add(name);
String[] sexItem={"男","女"};;
JComboBox sex=new JComboBox(sexItem);
jp2.add(new JLabel("性 别"));
jp2.add(sex);
jp3.add(new JLabel("年 龄"));
jp3.add(age);
birthday=new JTextField(10);
ZD=new JTextField(10);//诊断
inday=new JTextField(10);//诊断
jp4.add(new JLabel("生 日"));
jp4.add(birthday);
jp5.add(new JLabel("入院时间"));
jp5.add(inday);
jp7.add(new JLabel("主管医生"));
jp7.add(doctor);
jp6.add(new JLabel("诊 断"));
jp6.add(ZD);
jp11.add(jp1);
jp11.add(jp2);
jp11.add(jp3);
jp11.add(jp4);
jp11.add(jp5);
jp11.add(jp7);
jp11.add(jp6);
jp12=new JPanel(new BorderLayout());
enter=new JButton(new ImageIcon("images/56.gif"));
jp12.add(enter);
jp.add(jp11);
jp.add(jp12);
add(jp);
setVisible(true);
}
//直接将其信息在数据库中删除??
public void subOut(String NUMBER){
}
public void modify(String NUMBER){
setTitle("修改床位信息");
int flag;
conectMsg databass=new conectMsg(NUMBER);
flag=databass.check();
setSize(480,280);
setLocation(250,300);
//modify title image
ImageIcon title=new ImageIcon("images/72.gif");
setIconImage(title.getImage());
jp=new JPanel(new GridLayout(1,2));
jp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("信息"),
BorderFactory.createEmptyBorder(0,0,0,5)));
jp11=new JPanel(new GridLayout(7,1));
jp1=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp2=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp3=new JPanel(new FlowLayout(FlowLayout.LEFT));
jp4=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp5=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp6=new JPanel(new FlowLayout(FlowLayout.LEADING));
jp7=new JPanel(new FlowLayout(FlowLayout.LEADING));
mod1=new JButton("修改"); mod1.addActionListener(this);
mod2=new JButton("修改"); mod2.addActionListener(this);
mod3=new JButton("修改"); mod3.addActionListener(this);
mod4=new JButton("修改"); mod4.addActionListener(this);
mod5=new JButton("修改"); mod5.addActionListener(this);
mod6=new JButton("修改"); mod6.addActionListener(this);
mod7=new JButton("修改"); mod7.addActionListener(this);
mod8=new JButton("修改"); mod8.addActionListener(this);
name=new JTextField(8);
jp1.add(new JLabel("姓 名"));
name.setText(conectMsg.sickName);
name.setForeground(Color.blue);
name.setEditable(false);
//name.setSelectedTextColor
jp1.add(name);
jp1.add(mod1);
sex2=new JTextField(8);
jp2.add(new JLabel("性 别"));
sex2.setText(conectMsg.sex);
sex2.setForeground(Color.blue);
sex2.setEditable(false);
jp2.add(sex2);
jp2.add(mod2);
age=new JTextField(8);
jp3.add(new JLabel("年 龄"));
age.setText(conectMsg.age);
age.setForeground(Color.blue);
age.setEditable(false);
jp3.add(age);
jp3.add(mod3);
birthday=new JTextField(8);
ZD=new JTextField(8);//诊断
inday=new JTextField(8);
doctor=new JTextField(8);
jp4.add(new JLabel("生 日"));
birthday.setText(conectMsg.birthday);
birthday.setForeground(Color.blue);
birthday.setEditable(false);
jp4.add(birthday);
jp4.add(mod4);
jp5.add(new JLabel("入院时间"));
inday.setText(conectMsg.medTime);
inday.setForeground(Color.blue);
inday.setEditable(false);
jp5.add(inday);
jp5.add(mod5);
jp7.add(new JLabel("主管医生"));
doctor.setText(conectMsg.docName);
doctor.setForeground(Color.blue);
doctor.setEditable(false);
jp7.add(doctor);
jp7.add(mod8);
jp6.add(new JLabel("诊 断"));
ZD.setText(conectMsg.diagnoses);
ZD.setForeground(Color.blue);
ZD.setEditable(false);
jp6.add(ZD);
jp6.add(mod6);
jp11.add(jp1);
jp11.add(jp2);
jp11.add(jp3);
jp11.add(jp4);
jp11.add(jp5);
jp11.add(jp7);
jp11.add(jp6);
jp12=new JPanel(new BorderLayout());
jp121=new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel jp122=new JPanel(new FlowLayout());
bedNo=new JTextField(8);
jp121.add(new JLabel("床 号"));
bedNo.setText(conectMsg.bedNo);
bedNo.setForeground(Color.blue);
bedNo.setEditable(false);
jp121.add(bedNo);
jp121.add(mod7);
enter=new JButton(new ImageIcon("images/56.gif"));
enter.addActionListener(this);
jp122.add(enter);
jp12.add("North",jp121);
jp12.add("Center",jp122);
jp.add(jp11);
jp.add(jp12);
add(jp);
setVisible(true);
}
public void actionPerformed(ActionEvent e){
Object cmd=e.getSource();
if(cmd.equals(mod1)){
name.setEditable(true);
}
if(cmd.equals(mod2)){
sex2.setEditable(true);
}
if(cmd.equals(mod3)){
age.setEditable(true);
}
if(cmd.equals(mod4)){
birthday.setEditable(true);
}
if(cmd.equals(mod5)){
inday.setEditable(true);
}if(cmd.equals(mod6)){
ZD.setEditable(true);
}if(cmd.equals(mod7)){
bedNo.setEditable(true);
}
if(cmd.equals(mod8)){
doctor.setEditable(true);
}
if(cmd.equals(enter)){
//sickName=name.getText();
//sex=name.getText();
//age=name.getText();
//birthday=name.getText();
//medTime=name.getText();
//conectMsg.diagnoses=name.getText();
//bedNo=name.getText();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -