📄 setmessage.java~26~
字号:
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 com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.border.EtchedBorder;
import java.awt.Color;
import javax.swing.border.Border;
import java.awt.Font;
import java.util.Vector;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
public class SetMessage extends JFrame {
public SetMessage() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) {
SetMessage setmessage = new SetMessage();
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
vec1.addElement(" 硕 士") ;
vec1.addElement(" 研 究 生") ;
vec1.addElement(" 本 科") ;
vec1.addElement(" 大 专") ;
vec1.addElement(" 高 中") ;
vec1.addElement(" 中 专") ;
vec1.addElement(" 初 中") ;
diploma_l.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
diploma_l.setBorder(BorderFactory.createEtchedBorder());
diploma_l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jLabel3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel3.setBorder(BorderFactory.createEtchedBorder());
jLabel3.setText(" 文化程度:");
jButton3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton3.setText("添 加");
jButton3.addActionListener(new SetMessage_jButton3_actionAdapter(this));
xYLayout1.setWidth(573);
jButton7.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton7.setText("删 除");
jButton7.addActionListener(new SetMessage_jButton7_actionAdapter(this));
jButton8.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton8.setText("删 除");
jButton8.addActionListener(new SetMessage_jButton8_actionAdapter(this));
jButton9.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton9.setText("删 除");
jButton9.addActionListener(new SetMessage_jButton9_actionAdapter(this));
jLabel5.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel5.setBorder(BorderFactory.createEtchedBorder());
jLabel5.setText(" 民 族:");
jButton10.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton10.setText("添 加");
jButton10.addActionListener(new SetMessage_jButton10_actionAdapter(this));
vecnation.addElement(" 汉 族") ;
vecnation.addElement(" 满 族") ;
vecnation.addElement(" 蒙 古 族") ;
vecnation.addElement(" 回 族") ;
nation_l.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
nation_l.setBorder(BorderFactory.createEtchedBorder());
nation_l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jButton11.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton11.setText("删 除");
jButton11.addActionListener(new SetMessage_jButton11_actionAdapter(this));
jLabel6.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel6.setBorder(BorderFactory.createEtchedBorder());
jLabel6.setText(" 准驾类型:");
jButton12.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton12.setText("添 加");
jButton12.addActionListener(new SetMessage_jButton12_actionAdapter(this));
vecdrive.addElement(" A 1");
vecdrive.addElement(" A 2");
vecdrive.addElement(" A 3");
vecdrive.addElement(" B 1");
vecdrive.addElement(" B 2");
vecdrive.addElement(" C 1");
vecdrive.addElement(" C 2");
vecdrive.addElement(" C 3");
vecdrive.addElement(" C 4");
vecdrive.addElement(" D ");
vecdrive.addElement(" E ");
vecdrive.addElement(" F ");
vecdrive.addElement(" M ");
vecdrive.addElement(" N ");
vecdrive.addElement(" P ");
drivetype_l.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
drivetype_l.setBorder(BorderFactory.createEtchedBorder());
drivetype_l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
vecburn.addElement(" 汽 油");
vecburn.addElement(" 柴 油");
vecburn.addElement(" 机 油");
burntype_l.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
burntype_l.setBorder(BorderFactory.createEtchedBorder());
burntype_l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jButton4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton4.setText("添 加");
jButton4.addActionListener(new SetMessage_jButton4_actionAdapter(this));
jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jLabel4.setBorder(BorderFactory.createEtchedBorder());
jLabel4.setText(" 燃油类型:");
jButton1.addActionListener(new SetMessage_jButton1_actionAdapter(this));
jButton1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton1.setText("返 回");
jButton2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
jButton2.setText("保 存");
this.setTitle("沈阳志远出租汽车公司出租车信息管理系统--基本信息设置窗口");
this.getContentPane().add(burnscroll, new XYConstraints(406, 41, 124, 140));
this.getContentPane().add(jLabel4, new XYConstraints(322, 41, -1, 31));
this.getContentPane().add(jButton3, new XYConstraints(35, 92, 80, 34));
this.getContentPane().add(jButton7, new XYConstraints(36, 146, 79, 34));
this.getContentPane().add(jButton8, new XYConstraints(323, 146, 79, 34));
this.getContentPane().add(jButton4, new XYConstraints(323, 92, 80, 34));
this.getContentPane().add(nationscroll, new XYConstraints(121, 228, 123, 135));
this.getContentPane().add(jButton10, new XYConstraints(38, 280, 79, 31));
this.getContentPane().add(jButton9, new XYConstraints(39, 329, 79, 34));
this.getContentPane().add(jLabel6, new XYConstraints(324, 229, -1, 31));
this.getContentPane().add(jButton12, new XYConstraints(326, 280, 79, 34));
this.getContentPane().add(jButton11, new XYConstraints(327, 329, 79, 34));
this.getContentPane().add(drivescroll, new XYConstraints(408, 229, 122, 134));
this.getContentPane().add(jLabel3, new XYConstraints(35, 40, -1, 31));
this.getContentPane().add(jLabel5, new XYConstraints(38, 228, -1, 31));
this.getContentPane().add(listscrollpane,
new XYConstraints(119, 40, 126, 139));
this.getContentPane().add(jButton1, new XYConstraints(330, 408, 100, 42));
this.getContentPane().add(jButton2, new XYConstraints(144, 409, 99, 41));
this.setVisible(true) ;
this.setSize(580,520) ;
this.setLocation(150,100) ;
addWindowListener(new WindowAdapter() {
public void WindowClosing(WindowEvent e) {
dispose();
}
});
}
XYLayout xYLayout1 = new XYLayout();
Border border1 = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.white, new Color(178, 178, 178));
Border border2 = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.white, new Color(178, 178, 178));
Border border3 = BorderFactory.createEtchedBorder(Color.white,
new Color(165, 163, 151));
Vector vec1= new Vector();
JList diploma_l = new JList(vec1);
JScrollPane listscrollpane=new JScrollPane(diploma_l);
JLabel jLabel3 = new JLabel();
JButton jButton3 = new JButton();
JLabel jLabel4 = new JLabel();
JButton jButton4 = new JButton();
Vector vecburn=new Vector() ;
JList burntype_l = new JList(vecburn);
JScrollPane burnscroll=new JScrollPane(burntype_l) ;
JButton jButton7 = new JButton();
JButton jButton8 = new JButton();
JButton jButton9 = new JButton();
JLabel jLabel5 = new JLabel();
JButton jButton10 = new JButton();
Vector vecnation=new Vector() ;
JList nation_l = new JList(vecnation);
JScrollPane nationscroll=new JScrollPane(nation_l) ;
JButton jButton11 = new JButton();
JLabel jLabel6 = new JLabel();
JButton jButton12 = new JButton();
Vector vecdrive=new Vector() ;
JList drivetype_l = new JList(vecdrive);
JScrollPane drivescroll=new JScrollPane(drivetype_l) ;
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public void jButton1_actionPerformed(ActionEvent e) {
this.dispose();
}
public void jButton3_actionPerformed(ActionEvent e) {
String inputValue1=JOptionPane.showInputDialog("请输入新类型:") ;
//System.out.print(inputValue1) ;
diploma_l.add(inputValue1,null);
}
public void jButton4_actionPerformed(ActionEvent e) {
String inputValue2=JOptionPane.showInputDialog("请输入新类型:") ;
burntype_l.add(inputValue2,null);
}
public void jButton10_actionPerformed(ActionEvent e) {
String inputValue3=JOptionPane.showInputDialog("请输入新类型:") ;
nation_l.add(inputValue3,null);
}
public void jButton12_actionPerformed(ActionEvent e) {
String inputValue4=JOptionPane.showInputDialog("请输入新类型:") ;
drivetype_l.add(inputValue4,null);
}
public void jButton7_actionPerformed(ActionEvent e) {
int n;
n=diploma_l.getSelectedIndex();
// System.out.print(n);
if(n<0)
JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
else
diploma_l.remove(n);
}
public void jButton8_actionPerformed(ActionEvent e) {
int n;
n=burntype_l.getSelectedIndex();
if(n<0)
JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
else
burntype_l.remove(n);
}
public void jButton9_actionPerformed(ActionEvent e) {
int n;
n=nation_l.getSelectedIndex();
if(n<0)
JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
else
nation_l.remove(n);
}
public void jButton11_actionPerformed(ActionEvent e) {
int n;
n=drivetype_l.getSelectedIndex();
if(n<0)
JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
else
drivetype_l.remove(n);
}
}
class SetMessage_jButton11_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton11_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton11_actionPerformed(e);
}
}
class SetMessage_jButton9_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton9_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton9_actionPerformed(e);
}
}
class SetMessage_jButton8_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton8_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton8_actionPerformed(e);
}
}
class SetMessage_jButton7_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton7_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton7_actionPerformed(e);
}
}
class SetMessage_jButton12_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton12_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton12_actionPerformed(e);
}
}
class SetMessage_jButton10_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton10_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton10_actionPerformed(e);
}
}
class SetMessage_jButton4_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton4_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
class SetMessage_jButton3_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton3_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class SetMessage_jButton1_actionAdapter implements ActionListener {
private SetMessage adaptee;
SetMessage_jButton1_actionAdapter(SetMessage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -