📄 newweizhang.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.Border;
import javax.swing.border.EtchedBorder;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.sql.ResultSet;
import java.awt.event.FocusEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class Newweizhang extends JFrame {
public Newweizhang() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
// public static void main(String[] args) {
// Newweizhang newweizhang = new Newweizhang();
// }
private void jbInit() throws Exception {
jLabel1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel1.setBorder(border1);
jLabel1.setText(" 违章车号:");
this.getContentPane().setLayout(xYLayout1);
jLabel3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel3.setBorder(BorderFactory.createEtchedBorder());
jLabel3.setText(" 违章日期:");
jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel4.setBorder(BorderFactory.createEtchedBorder());
jLabel4.setText(" 违章地点:");
breaklowaddress_t.setNextFocusableComponent(penaltymoney_t);
breaklowaddress_t.setText("");
breaklowaddress_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
breaklowaddress_t_focusLost(e);
}
});
jLabel5.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel5.setBorder(BorderFactory.createEtchedBorder());
jLabel5.setText(" 罚款金额:");
penaltymoney_t.setNextFocusableComponent(unit_t);
penaltymoney_t.setText("");
penaltymoney_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
penaltymoney_t_focusLost(e);
}
});
xYLayout1.setWidth(567);
xYLayout1.setHeight(458);
jLabel6.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel6.setBorder(BorderFactory.createEtchedBorder());
jLabel6.setText(" 处理单位:");
unit_t.setNextFocusableComponent(breaklowreason_a);
unit_t.setText("");
unit_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
unit_t_focusLost(e);
}
});
jLabel7.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel7.setBorder(BorderFactory.createEtchedBorder());
jLabel7.setText(" 违章原因:");
breaklowreason_a.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
breaklowreason_a.setBorder(border2);
breaklowreason_a.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
breaklowreason_a_keyPressed(e);
}
});
breaklowreason_a.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
breaklowreason_a_focusLost(e);
}
});
jButton1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton1.setToolTipText("清 空");
jButton1.addActionListener(new Newweizhang_jButton1_actionAdapter(this));
jButton2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton2.setToolTipText("添 加");
jButton2.addActionListener(new Newweizhang_jButton2_actionAdapter(this));
jButton3.setBackground(Color.white);
jButton3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton3.setToolTipText("返 回");
jButton3.addActionListener(new Newweizhang_jButton3_actionAdapter(this));
jLabel8.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel8.setBorder(BorderFactory.createEtchedBorder());
jLabel8.setText(" 元");
breakdate_t.setNextFocusableComponent(breaklowaddress_t);
breakdate_t.setText("");
breakdate_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
breakdate_t_focusLost(e);
}
});
breakcarid_t.addFocusListener(new Newweizhang_breakcarid_t_focusAdapter(this));
drivername_t.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
drivername_t_focusLost(e);
}
});
this.setTitle(
"沈阳志远出租汽车公司出租车信息管理系统--添加违章信息窗口");
breakcarid_t.setNextFocusableComponent(drivername_t);
drivername_t.setNextFocusableComponent(breakdate_t);
this.getContentPane().add(jLabel1, new XYConstraints(67, 42, 82, 31));
drivername_t.setText("");
jLabel2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel2.setBorder(border1);
jLabel2.setText(" 驾驶员姓名:");
this.getContentPane().add(breakcarid_t,
new XYConstraints(151, 42, 103, 31));
this.getContentPane().add(jLabel3, new XYConstraints(67, 89, -1, 31));
this.getContentPane().add(jLabel5, new XYConstraints(67, 138, -1, 31));
this.getContentPane().add(jLabel2, new XYConstraints(314, 43, -1, 31));
this.getContentPane().add(jLabel6, new XYConstraints(314, 138, 96, 31));
this.getContentPane().add(jLabel4, new XYConstraints(314, 90, 96, 31));
this.getContentPane().add(breaklowaddress_t,
new XYConstraints(412, 90, 101, 31));
this.getContentPane().add(unit_t,
new XYConstraints(412, 138, 101, 31));
this.getContentPane().add(drivername_t,
new XYConstraints(412, 43, 102, 31));
this.getContentPane().add(jLabel7, new XYConstraints(67, 189, -1, 31));
this.getContentPane().add(breaklowreason_a,
new XYConstraints(151, 189, 360, 143));
this.getContentPane().add(penaltymoney_t,
new XYConstraints(151, 138, 70, 31));
this.getContentPane().add(jLabel8, new XYConstraints(220, 138, 31, 31));
this.getContentPane().add(breakdate_t,
new XYConstraints(151, 89, 103, 31));
this.getContentPane().add(jButton1, new XYConstraints(389, 375, 89, 47));
this.getContentPane().add(jButton2, new XYConstraints(106, 375, 86, 47));
this.getContentPane().add(jButton3, new XYConstraints(244, 375, 89, 47));
this.setVisible(true);
this.setSize(565, 487);
this.setLocation(170, 50);
addWindowListener(new WindowAdapter() {
public void WindowClosing(WindowEvent e) {
if (db != null)
db.closeConnection();
dispose();
}
});
}
DataBaseManager db = null;
ResultSet r;
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
Border border1 = BorderFactory.createEtchedBorder(Color.white,
new Color(165, 163, 151));
JTextField breakcarid_t = new JTextField();
JLabel jLabel2 = new JLabel();
JTextField drivername_t = new JTextField();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField breaklowaddress_t = new JTextField();
JLabel jLabel5 = new JLabel();
JTextField penaltymoney_t = new JTextField();
JLabel jLabel6 = new JLabel();
JTextField unit_t = new JTextField();
JLabel jLabel7 = new JLabel();
JTextArea breaklowreason_a = new JTextArea();
Border border2 = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.white, new Color(178, 178, 178));
JButton jButton1 = new JButton(new ImageIcon("image\\48.gif"));
JButton jButton2 = new JButton(new ImageIcon("image\\163.gif"));
JButton jButton3 = new JButton(new ImageIcon("image\\back.gif"));
JLabel jLabel8 = new JLabel();
JTextField breakdate_t = new JTextField();
public void jButton1_actionPerformed(ActionEvent e) {
breakcarid_t.setText("");
drivername_t.setText("");
breaklowaddress_t.setText("");
breakdate_t.setText("");
penaltymoney_t.setText("");
unit_t.setText("");
breaklowreason_a.setText("");
}
public void jButton3_actionPerformed(ActionEvent e) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -