?? diagnoseregister.java
字號:
package yd.pethospital.diagnoseregister.view;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import yd.pethospital.diagnose.jdbc.*;
public class DiagnoseRegister {
public static JFrame frame;
public static JTable BTCK; //表格
public static JButton BAdd,BDel, BBack; //增加 刪除 返回 按鈕
public static int Mess;
JLabel LTitle; //標(biāo)題 標(biāo)簽
public DiagnoseRegister(){
frame=new JFrame(); //設(shè)置窗體
frame.setBounds(180, 100, 740, 500); //位置 大小 不可改變大小 空布局 標(biāo)題
frame.setResizable(false);
frame.setLayout(null);
frame.setTitle("診斷登記");
frame.validate();
new DiagnoseCommon();
LTitle=new JLabel("診斷登記"); //設(shè)置標(biāo)題標(biāo)簽
LTitle.setFont(new Font(null,Font.TYPE1_FONT,28));
LTitle.setBounds(330,15,120,40);
RegisterGet Reget=new RegisterGet();
BTCK=new JTable(Reget); //創(chuàng)建 設(shè)置表格
JScrollPane JSPane=new JScrollPane(BTCK);
JSPane.setBounds(80,50,600,360);
BTCK.setVisible(true);
BTCK.addMouseListener(new MouseListener(){ //添加表格的監(jiān)聽器
public void mouseClicked(MouseEvent e) {
if(e.getClickCount()==2){ //雙擊表格事件
new ChangeDiagnose();
ChangeDiagnoseGet.GetText();
frame.dispose();
}
}
public void mouseEntered(MouseEvent arg0) {}
public void mouseExited(MouseEvent arg0) {}
public void mousePressed(MouseEvent arg0) {}
public void mouseReleased(MouseEvent arg0) {}
});
BAdd=new JButton("新增");
BDel=new JButton("刪除");
BBack=new JButton("返回");
BAdd.setBounds(160,420,70,30); //新增按鈕
BAdd.setFont(new Font(null,Font.BOLD,14));
BDel.setBounds(320,420,70,30); //刪除按鈕
BDel.setFont(new Font(null,Font.BOLD,14));
BBack.setBounds(480,420,70,30); //返回按鈕
BBack.setFont(new Font(null,Font.BOLD,14));
frame.add(BAdd);
BAdd.addActionListener(new ActionListener(){ //添加新增按鈕 監(jiān)聽器
public void actionPerformed(ActionEvent arg0) {
new NewDiagnose();
frame.dispose();
}
});
frame.add(BDel);
BDel.addActionListener(new ActionListener(){ //添加刪除按鈕 監(jiān)聽器
public void actionPerformed(ActionEvent arg0) {
Mess=JOptionPane.showConfirmDialog(null, "確認(rèn)是否刪除所選信息?", "系統(tǒng)信息提示", JOptionPane.YES_NO_OPTION);
if(Mess==JOptionPane.YES_OPTION){
new DeleteDiagnose();
}
}
});
frame.add(BBack);
BBack.addActionListener(new ActionListener(){ //添加返回 監(jiān)聽器
public void actionPerformed(ActionEvent arg0) {
frame.dispose();
}
});
frame.add(LTitle);
frame.add(JSPane);
frame.setVisible(true);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -