📄 frm_main.java
字号:
/**
* This method initializes mnuitem_doctor
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getMnuitem_doctor() {
if (mnuitem_doctor == null) {
mnuitem_doctor = new JMenuItem();
mnuitem_doctor.setText("Doctors' Details");
mnuitem_doctor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
pnl_main.removeAll();
// Loads the panel for doctor's details
doctor_details=new Pnl_doctor();
GridBagConstraints gbc_doctor=new GridBagConstraints();
gbc_doctor.weightx = 0.0D;
gbc_doctor.weighty = 0.0D;
gbc_doctor.fill = java.awt.GridBagConstraints.NONE;
gbc_doctor.anchor = GridBagConstraints.NORTHWEST;
pnl_main.add(doctor_details, gbc_doctor);
pnl_main.updateUI();
}
});
}
return mnuitem_doctor;
}
/**
* This method initializes mnuitem_staff
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getMnuitem_staff() {
if (mnuitem_staff == null) {
mnuitem_staff = new JMenuItem();
mnuitem_staff.setText("Staff Details");
mnuitem_staff.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
pnl_main.removeAll();
// Loads the panel for staff details
staff_details=new Pnl_staff();
GridBagConstraints gbc_staff=new GridBagConstraints();
gbc_staff.weightx = 0.0D;
gbc_staff.weighty = 0.0D;
gbc_staff.fill = java.awt.GridBagConstraints.NONE;
gbc_staff.anchor = GridBagConstraints.NORTHWEST;
pnl_main.add(staff_details, gbc_staff);
pnl_main.updateUI();
}
});
}
return mnuitem_staff;
}
/**
* This method initializes mnuitem_medicines
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getMnuitem_medicines() {
if (mnuitem_medicines == null) {
mnuitem_medicines = new JMenuItem();
mnuitem_medicines.setText("Find Medicine");
mnuitem_medicines.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
pnl_main.removeAll();
// Loads the panel for drug inventory
drug_inven=new Pnl_Druginventory();
GridBagConstraints gbc_drug_invent=new GridBagConstraints();
gbc_drug_invent.weightx = 0.0D;
gbc_drug_invent.weighty = 0.0D;
gbc_drug_invent.gridx=0;
gbc_drug_invent.gridy=0;
gbc_drug_invent.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc_drug_invent.anchor = GridBagConstraints.CENTER;
pnl_main.add(drug_inven, gbc_drug_invent);
med_table=new pnl_medicinelist();
GridBagConstraints gbc_medtable=new GridBagConstraints();
gbc_medtable.weightx = 1.0D;
gbc_medtable.weighty = 1.0D;
gbc_medtable.gridx=0;
gbc_medtable.gridy=1;
gbc_medtable.fill = java.awt.GridBagConstraints.BOTH;
gbc_medtable.anchor = GridBagConstraints.NORTHWEST;
pnl_main.add(med_table,gbc_medtable);
pnl_main.updateUI();
}
});
}
return mnuitem_medicines;
}
/**
* This method initializes mnuitem_orders
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getMnuitem_orders() {
if (mnuitem_orders == null) {
mnuitem_orders = new JMenuItem();
mnuitem_orders.setText("Orders");
}
return mnuitem_orders;
}
/**
* This method initializes mnu_theme
*
* @return javax.swing.JMenu
*/
private JMenu getMnu_theme() {
if (mnu_theme == null) {
mnu_theme = new JMenu();
mnu_theme.setText("Theme");
mnu_theme.add(getCbmnuitem_aqua());
mnu_theme.add(getCbmnuitem_System());
mnu_theme.setMnemonic(java.awt.event.KeyEvent.VK_T);
}
return mnu_theme;
}
private void changeLnF(String lnf) {
try {
UIManager.setLookAndFeel(lnf);
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception e) {
}
}
/**
* This method initializes cbmnuitem_aqua
*
* @return javax.swing.JCheckBoxMenuItem
*/
private JCheckBoxMenuItem getCbmnuitem_aqua() {
if (cbmnuitem_aqua == null) {
cbmnuitem_aqua = new JCheckBoxMenuItem();
// cbmnuitem_aqua.setMnemonic(java.awt.event.KeyEvent.VK_A);
cbmnuitem_aqua.setText("Aqua");
cbmnuitem_aqua.setSelected(true);
// cbmnuitem_aqua.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
// java.awt.event.KeyEvent.VK_A, java.awt.Event.CTRL_MASK,
// false));
cbmnuitem_aqua.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
changeLnF("com.birosoft.liquid.LiquidLookAndFeel");
cbmnuitem_System.setSelected(false);
}
});
}
return cbmnuitem_aqua;
}
/**
* This method initializes cbmnuitem_System
*
* @return javax.swing.JCheckBoxMenuItem
*/
private JCheckBoxMenuItem getCbmnuitem_System() {
if (cbmnuitem_System == null) {
cbmnuitem_System = new JCheckBoxMenuItem();
cbmnuitem_System.setText("System");
cbmnuitem_System.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
changeLnF(UIManager.getSystemLookAndFeelClassName());
cbmnuitem_aqua.setSelected(false);
}
});
}
return cbmnuitem_System;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mainfrm=new frm_main();
mainfrm.setVisible(true);
}
/**
* This is the default constructor
*/
public frm_main() {
super();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(900, 800);
this.setResizable(true);
this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
this.setJMenuBar(getMnubar());
this.setContentPane(getJContentPane());
this.setTitle("RDMS");
// this.getContentPane().add(getJContentPane(), null);
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
gridBagConstraints1.anchor = java.awt.GridBagConstraints.CENTER;
gridBagConstraints1.weighty = 1.0D;
gridBagConstraints1.weightx = 1.0D;
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.gridy = 0;
gridBagConstraints.insets = new java.awt.Insets(5,5,5,5);
gridBagConstraints.weightx = 0.0D;
gridBagConstraints.weighty = 0.0D;
gridBagConstraints.anchor = java.awt.GridBagConstraints.CENTER;
gridBagConstraints.gridx = 0;
jContentPane = new JPanel();
jContentPane.setLayout(new GridBagLayout());
jContentPane.setPreferredSize(new java.awt.Dimension(900,800));
jContentPane.add(getPnl_mail(), gridBagConstraints1);
}
return jContentPane;
}
public void insertvalues() {
// java.sql.Statement stmt1;
//// ResultSet rs1;
// java.sql.Connection conn1;
//
// try
// {
// Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// }
// catch(Exception e1)
// {
// System.out.println("\nClass not found\n");
// }
// try {
// conn1=DriverManager.getConnection("jdbc:odbc:rdms_pr");
// stmt1=conn1.createStatement();
//// rs1=stmt1.executeQuery("Select * from inpatient");//
// String a= patient_personal.inpatient.tf_caseid.getText();
// System.out.println(a);
//// stmt1.execute("INSERT INTO INPATIENT VALUES ('"+a+"','bss', 17, 'm', 'ab', 'gdfgfh', 'gdgdfg', 982523922)");
//// ResultSetMetaData rsmd1=rs1.getMetaData();
//// System.out.println("No of Column ::"+rsmd1.getColumnCount());
//// pnl_inpatient inp= new pnl_inpatient();
//// while(rs1.next())
//// {
////
//// //System.out.println(rs1.getString(1));
////// inp.setText(rs1.getString(1));
////
//// }
// stmt1.close();
// conn1.close();
// } catch (SQLException e1) {
//
//// System.out.println(e1);
// e1.printStackTrace();
// JOptionPane.showMessageDialog(null,"Error in insertion in table Inpatient!","Invalid Input",0);
// }
JOptionPane.showMessageDialog(null,"Error in insertion in table Inpatient!","Invalid Input",0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -