📄 updatejiaofei.java
字号:
package car;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
import javax.swing.*;
import java.awt.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.border.EtchedBorder;
import javax.swing.border.Border;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.Font;
import java.sql.SQLException;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class Updatejiaofei extends JFrame {
public Updatejiaofei() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
// public static void main(String[] args) {
// Updatejiaofei updatejiaofei = new Updatejiaofei();
// }
private void jbInit() throws Exception {
jButton1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton1.setText("查找");
jButton1.addActionListener(new Updatejiaofei_jButton1_actionAdapter(this));
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setLayout(xYLayout1);
this.getContentPane().setLayout(xYLayout2);
findcarid_t.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
findcarid_t.setText("");
findcarid_t.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
findcarid_t_keyPressed(e);
}
});
findcarid_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent focusEvent) {
findcarid_t_focusLost(focusEvent);
}
});
xYLayout2.setWidth(555);
xYLayout2.setHeight(622);
jLabel2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel2.setBorder(BorderFactory.createEtchedBorder());
jLabel2.setToolTipText("");
jLabel2.setText(" 收款单位:");
jLabel3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel3.setBorder(BorderFactory.createEtchedBorder());
jLabel3.setToolTipText("");
jLabel3.setText(" 截止日期:");
jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel4.setBorder(BorderFactory.createEtchedBorder());
jLabel4.setToolTipText("");
jLabel4.setText(" 车牌号:");
jLabel5.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel5.setBorder(BorderFactory.createEtchedBorder());
jLabel5.setToolTipText("");
jLabel5.setText(" 起始日期:");
jLabel6.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel6.setBorder(BorderFactory.createEtchedBorder());
jLabel6.setToolTipText("");
jLabel6.setText(" 收款人:");
carid_t.setText("");
jLabel7.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel7.setBorder(BorderFactory.createEtchedBorder());
jLabel7.setToolTipText("");
jLabel7.setText(" 费用种类:");
person_t.setText("");
jLabel8.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel8.setBorder(BorderFactory.createEtchedBorder());
jLabel8.setToolTipText("");
jLabel8.setText(" 费用金额:");
jComboBox1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
money_t.setText("");
jLabel9.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel9.setBorder(BorderFactory.createEtchedBorder());
jLabel9.setToolTipText("");
jLabel9.setText(" 交费日期:");
demo_a.setBorder(border1);
demo_a.setText("");
jLabel10.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel10.setBorder(BorderFactory.createEtchedBorder());
jLabel10.setToolTipText("");
jLabel10.setText(" 备注:");
jButton3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton3.setToolTipText("保存修改");
jButton3.addActionListener(new Updatejiaofei_jButton3_actionAdapter(this));
jButton4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton4.setToolTipText("删除该记录");
jButton4.addActionListener(new Updatejiaofei_jButton4_actionAdapter(this));
jButton5.setBackground(Color.white);
jButton5.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton5.setToolTipText("返 回");
jButton5.addActionListener(new Updatejiaofei_jButton5_actionAdapter(this));
jLabel11.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel11.setBorder(BorderFactory.createEtchedBorder());
jLabel11.setToolTipText("");
jLabel11.setText(" 元");
this.setTitle("沈阳志远出租汽车公司出租车信息管理系统--缴费信息管理窗口");
jButton2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton2.setToolTipText("上一条");
jButton2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
}
});
jButton6.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton6.setToolTipText("下一条");
jButton6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton6_actionPerformed(e);
}
});
jPanel1.add(jLabel1, new XYConstraints(51, 11, 107, 26));
jPanel1.add(findcarid_t, new XYConstraints(155, 8, 117, 30));
this.getContentPane().add(jLabel5, new XYConstraints(52, 145, -1, 31));
this.getContentPane().add(jLabel7, new XYConstraints(307, 100, -1, 31));
this.getContentPane().add(jComboBox1,
new XYConstraints(392, 100, 111, 31));
this.getContentPane().add(jLabel4, new XYConstraints(52, 99, 82, 31));
this.getContentPane().add(carid_t, new XYConstraints(137, 99, 111, 31));
this.getContentPane().add(demo_a, new XYConstraints(137, 281, 364, 169));
this.getContentPane().add(jLabel10, new XYConstraints(53, 281, 82, 31));
this.getContentPane().add(person_t, new XYConstraints(137, 237, 111, 31));
this.getContentPane().add(jLabel2, new XYConstraints(307, 237, -1, 31));
this.getContentPane().add(unit_t, new XYConstraints(391, 237, 111, 31));
this.getContentPane().add(jLabel6, new XYConstraints(53, 237, 82, 31));
this.getContentPane().add(jLabel8, new XYConstraints(307, 192, -1, 31));
this.getContentPane().add(jLabel9, new XYConstraints(52, 192, -1, 31));
this.getContentPane().add(jLabel3, new XYConstraints(307, 145, -1, 31));
this.getContentPane().add(money_t, new XYConstraints(392, 192, 82, 31));
this.getContentPane().add(jLabel11, new XYConstraints(473, 192, 30, 31));
this.getContentPane().add(begindate_t,
new XYConstraints(137, 145, 110, 31));
this.getContentPane().add(givemoney_t,
new XYConstraints(137, 192, 110, 30));
this.getContentPane().add(enddate_t,
new XYConstraints(391, 145, 112, 30));
this.getContentPane().add(jPanel1, new XYConstraints(27, 23, 498, 49));
this.getContentPane().add(jButton5, new XYConstraints(237, 508, 103, 52));
jPanel1.add(jButton1, new XYConstraints(366, 6, 114, 34));
this.getContentPane().add(jButton2, new XYConstraints(52, 545, 111, 45));
this.getContentPane().add(jButton3, new XYConstraints(52, 480, 111, 45));
this.getContentPane().add(jButton6, new XYConstraints(397, 545, 106, 45));
this.getContentPane().add(jButton4, new XYConstraints(397, 481, 106, 45));
jLabel1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel1.setText("请输入车牌号:");
this.setVisible(true);
this.setSize(575, 647);
this.setLocation(170, 50);
addWindowListener(new WindowAdapter() {
public void WindowClosing(WindowEvent e) {
if (db != null)
db.closeConnection();
dispose();
}
});
}
DataBaseManager db = null;
ResultSet r;
JPanel jPanel1 = new JPanel();
JButton jButton1 = new JButton(new ImageIcon("image\\114.gif"));
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
XYLayout xYLayout2 = new XYLayout();
JTextField findcarid_t = new JTextField();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JTextField carid_t = new JTextField();
JLabel jLabel7 = new JLabel();
JTextField person_t = new JTextField();
JLabel jLabel8 = new JLabel();
JComboBox jComboBox1 = new JComboBox();
JTextField unit_t = new JTextField();
JTextField money_t = new JTextField();
JLabel jLabel9 = new JLabel();
JTextArea demo_a = new JTextArea();
JLabel jLabel10 = new JLabel();
JButton jButton3 = new JButton(new ImageIcon("image\\bao.png"));
JButton jButton4 = new JButton(new ImageIcon("image\\delete.png"));
JButton jButton5 = new JButton(new ImageIcon("image\\back.gif"));
Border border1 = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.white, new Color(178, 178, 178));
JLabel jLabel11 = new JLabel();
JTextField begindate_t = new JTextField();
JTextField givemoney_t = new JTextField();
JTextField enddate_t = new JTextField();
JButton jButton2 = new JButton(new ImageIcon("image\\qian.gif"));
JButton jButton6 = new JButton(new ImageIcon("image\\hou.gif"));
public void jButton5_actionPerformed(ActionEvent e) {
if (db != null)
db.closeConnection();
dispose();
}
public void jButton1_actionPerformed(ActionEvent e) {
db = new DataBaseManager();
try {
String str1 = "select * from car where 车牌号='" +
findcarid_t.getText().trim() + "'";
String str2 = "select * from jiaofei where 车牌号='" +
findcarid_t.getText().trim() + "'";
if (findcarid_t.getText().trim().equals(""))
JOptionPane.showMessageDialog(null, "请输入车牌号!");
else if (!db.getResult(str1).first()) {
String s = "没有编号为" + findcarid_t.getText().trim() +
"的车辆,请重新输入车牌号。";
JOptionPane.showMessageDialog(null, s);
findcarid_t.setText("");
} else if (!db.getResult(str2).first()) {
String s = findcarid_t.getText().trim() +
"车辆的缴费信息不存在!";
JOptionPane.showMessageDialog(null, s);
findcarid_t.setText("");
} else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -