?? mainframe.java~195~
字號:
}
public void jMenuItem6_actionPerformed(ActionEvent e) {
ZcLbView zl = new ZcLbView();
zl.setTitle("添加類別信息");
zl.setSize(400, 400);
zl.btnDel.setEnabled(false);
zl.btnModify.setEnabled(false);
zl.setLocation(300, 100);
zl.setVisible(true);
}
public void jMenuItem7_actionPerformed(ActionEvent e) {
ZcLbView zl = new ZcLbView();
zl.setTitle("刪除類別信息");
zl.setSize(400, 400);
zl.btnAdd.setEnabled(false);
zl.btnModify.setEnabled(false);
zl.setLocation(300, 100);
zl.setVisible(true);
}
public void jMenuItem8_actionPerformed(ActionEvent e) {
ZcLbView zl = new ZcLbView();
zl.setTitle("修改類別信息");
zl.setSize(400, 400);
zl.btnDel.setEnabled(false);
zl.btnAdd.setEnabled(false);
zl.setLocation(300, 100);
zl.setVisible(true);
}
public void jMenuItem9_actionPerformed(ActionEvent e) {
LendView lend = new LendView();
lend.setTitle("借用資產");
lend.setSize(400, 400);
lend.btnReturn.setEnabled(false);
lend.setLocation(300, 100);
lend.setVisible(true);
}
public void jMenuItem10_actionPerformed(ActionEvent e) {
LendView lend = new LendView();
lend.setTitle("歸還資產");
lend.setSize(400, 400);
lend.btnBorrow.setEnabled(false);
lend.setLocation(300, 100);
lend.setVisible(true);
}
public void jScrollPane1_mouseClicked(MouseEvent e) {
}
public void jButton2_actionPerformed(ActionEvent e) {
con = new DbCon().getConnection();
try {
smt = con.createStatement();
if (table.getRowCount() > 0) {
for (int i = 0; table.getRowCount() > 0; i++) {
tm.removeRow(0);
}
}
rs = smt.executeQuery("select * from ASSET where asset_name='" +
txtFindName.getText() + "'");
while (rs.next()) {
String id = String.valueOf(rs.getInt("assetid")).trim();
String name = rs.getString("asset_name").trim();
String DlId = String.valueOf(rs.getInt("cateid")).trim();
String ZlId = String.valueOf(rs.getInt("subcateid")).trim();
String style = rs.getString("model").trim();
String price = String.valueOf(rs.getFloat("price")).trim();
String d = rs.getString("purchase_date").trim();
d = d.substring(0, d.indexOf(" "));
String gdate = d;
String status = rs.getString("status").trim();
String grr = rs.getString("useby").trim();
String context = rs.getString("remarks").trim();
String[] info = {id, name, DlId, ZlId, style, price, gdate,
status, grr, context};
tm.addRow(info);
}
} catch (SQLException ex) {
}
}
public void jButton3_actionPerformed(ActionEvent e) {
con = new DbCon().getConnection();
try {
smt = con.createStatement();
if (table.getRowCount() > 0) {
for (int i = 0; table.getRowCount() > 0; i++) {
tm.removeRow(0);
}
}
rs = smt.executeQuery("select * from ASSET");
while (rs.next()) {
String id = String.valueOf(rs.getInt("assetid")).trim();
String name = rs.getString("asset_name").trim();
String DlId = String.valueOf(rs.getInt("cateid")).trim();
String ZlId = String.valueOf(rs.getInt("subcateid")).trim();
String style = rs.getString("model").trim();
String price = String.valueOf(rs.getFloat("price")).trim();
String d = rs.getString("purchase_date").trim();
d = d.substring(0, d.indexOf(" "));
String gdate = d;
String status = rs.getString("status").trim();
String grr = rs.getString("useby").trim();
String context = rs.getString("remarks").trim();
String[] info = {id, name, DlId, ZlId, style, price, gdate,
status, grr, context};
tm.addRow(info);
}
} catch (SQLException ex) {
}
}
public void table_mouseClicked(MouseEvent e) {
con = new DbCon().getConnection();
txtZcId.setText("");
txtJyR.setText("");
txtJyDate.setText("");
txtGhDate.setText("");
txtZcId.setText((String) tm.getValueAt(table.getSelectedRow(), 0));
txtName.setText((String) tm.getValueAt(table.getSelectedRow(), 1));
txtDlId.setText((String) tm.getValueAt(table.getSelectedRow(), 2));
txtZlId.setText((String) tm.getValueAt(table.getSelectedRow(), 3));
txtStyle.setText((String) tm.getValueAt(table.getSelectedRow(), 4));
txtPrice.setText((String) tm.getValueAt(table.getSelectedRow(), 5));
String d = (String) tm.getValueAt(table.getSelectedRow(), 6);
txtGrDate.setText(d);
txtStatus.setText((String) tm.getValueAt(table.getSelectedRow(), 7));
txtGrR.setText((String) tm.getValueAt(table.getSelectedRow(), 8));
txtContent.setText((String) tm.getValueAt(table.getSelectedRow(), 9));
if (table.getSelectedRow() != -1) {
try {
rs = smt.executeQuery("select * from LEND where assetid='" +
txtZcId.getText() + "'");
if (rs.next()) {
txtJyR.setText(rs.getString("empno"));
d = rs.getString("usedate");
d = d.substring(0, d.indexOf(" "));
txtJyDate.setText(d);
d = rs.getString("retdate");
d = d.substring(0, d.indexOf(" "));
txtGhDate.setText(d);
if (rs.getString("isreturn").trim().equals("1"))
txtReturn.setText("否");
}
} catch (SQLException ex) {
}
}
}
public void jMenuItem11_actionPerformed(ActionEvent e) {
UserPsw user = new UserPsw();
user.setTitle("借用資產");
user.setSize(400, 400);
user.setLocation(300, 100);
user.setVisible(true);
}
}
class MainFrame_table_mouseAdapter extends MouseAdapter {
private MainFrame adaptee;
MainFrame_table_mouseAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e) {
adaptee.table_mouseClicked(e);
}
}
class MainFrame_jButton3_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jButton3_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class MainFrame_jScrollPane1_mouseAdapter extends MouseAdapter {
private MainFrame adaptee;
MainFrame_jScrollPane1_mouseAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e) {
adaptee.jScrollPane1_mouseClicked(e);
}
}
class MainFrame_jMenuItem9_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem9_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem9_actionPerformed(e);
}
}
class MainFrame_jMenuItem11_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem11_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem11_actionPerformed(e);
}
}
class MainFrame_jMenuItem10_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem10_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem10_actionPerformed(e);
}
}
class MainFrame_jMenuItem8_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem8_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem8_actionPerformed(e);
}
}
class MainFrame_jMenuItem7_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem7_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem7_actionPerformed(e);
}
}
class MainFrame_jMenuItem5_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem5_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem5_actionPerformed(e);
}
}
class MainFrame_jMenuItem4_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem4_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem4_actionPerformed(e);
}
}
class MainFrame_jMenuItem2_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem2_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem2_actionPerformed(e);
}
}
class MainFrame_jMenuItem1_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem1_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem1_actionPerformed(e);
}
}
class MainFrame_jButton1_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jButton1_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class MainFrame_jButton2_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jButton2_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class MainFrame_jMenuFileExit_ActionAdapter implements ActionListener {
MainFrame adaptee;
MainFrame_jMenuFileExit_ActionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent actionEvent) {
adaptee.jMenuFileExit_actionPerformed(actionEvent);
}
}
class MainFrame_jMenuItem3_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem3_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem3_actionPerformed(e);
}
}
class MainFrame_jMenuItem6_actionAdapter implements ActionListener {
private MainFrame adaptee;
MainFrame_jMenuItem6_actionAdapter(MainFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem6_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -