⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setmessage.java~29~

📁 出租车管理系统,为本人毕业设计. 还请大家多多指教了
💻 JAVA~29~
字号:
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;
import java.awt.List;

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);
        list1.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        list2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        list3.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        list4.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        list1.add("    硕    士") ;
        list1.add("    研 究 生") ;
        list1.add("    本    科") ;
        list1.add("    大    专") ;
        list1.add("    高    中") ;
        list1.add("    中    专") ;
        list1.add("    初    中") ;

        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));

        list3.add("   汉    族") ;
        list3.add("   满    族") ;
        list3.add("   蒙 古 族") ;
        list3.add("   回    族") ;


        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));

        list4.add("   A 1");
        list4.add("   A 2");
        list4.add("   A 3");
        list4.add("   B 1");
        list4.add("   B 2");
        list4.add("   C 1");
        list4.add("   C 2");
        list4.add("   C 3");
        list4.add("   C 4");
        list4.add("   D ");
        list4.add("   E ");
        list4.add("   F ");
        list4.add("   M ");
        list4.add("   N ");
        list4.add("   P ");


        list2.add("    汽    油");
        list2.add("    柴    油");
        list2.add("    机    油");


        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(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(jButton10, new XYConstraints(38, 280, 79, 31));
        this.getContentPane().add(jButton9, new XYConstraints(39, 329, 79, 34));
        this.getContentPane().add(jLabel3, new XYConstraints(35, 40, -1, 31));
        this.getContentPane().add(jLabel5, new XYConstraints(38, 228, -1, 31));
        this.getContentPane().add(jButton1, new XYConstraints(330, 408, 100, 42));
        this.getContentPane().add(jButton2, new XYConstraints(144, 409, 99, 41));
        this.getContentPane().add(list1, new XYConstraints(123, 40, 121, 139));
        this.getContentPane().add(list2, new XYConstraints(410, 40, 119, 139));
        this.getContentPane().add(list3, new XYConstraints(123, 228, 120, 135));
        this.getContentPane().add(list4, new XYConstraints(410, 229, 118, 133));
        this.getContentPane().add(jButton4, new XYConstraints(322, 92, 82, 34));
        this.getContentPane().add(jButton8, new XYConstraints(322, 145, 82, 34));
        this.getContentPane().add(jButton11, new XYConstraints(322, 329, 82, 34));
        this.getContentPane().add(jButton12, new XYConstraints(322, 280, 82, 34));
        this.getContentPane().add(jLabel6, new XYConstraints(322, 226, -1, 31));
        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));


    JLabel jLabel3 = new JLabel();
    JButton jButton3 = new JButton();
    JLabel jLabel4 = new JLabel();
    JButton jButton4 = new JButton();

    JButton jButton7 = new JButton();
    JButton jButton8 = new JButton();
    JButton jButton9 = new JButton();
    JLabel jLabel5 = new JLabel();
    JButton jButton10 = new JButton();

    JButton jButton11 = new JButton();
    JLabel jLabel6 = new JLabel();
    JButton jButton12 = new JButton();

    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    List list1 = new List();
    List list2 = new List();
    List list3 = new List();
    List list4 = new List();
    public void jButton1_actionPerformed(ActionEvent e) {

        this.dispose();
    }

    public void jButton3_actionPerformed(ActionEvent e) {
        String inputValue1=JOptionPane.showInputDialog("请输入新类型:") ;
//System.out.print(inputValue1) ;
        list1.add(inputValue1);

    }

    public void jButton4_actionPerformed(ActionEvent e) {
        String inputValue2=JOptionPane.showInputDialog("请输入新类型:") ;

        list2.add(inputValue2);
    }

    public void jButton10_actionPerformed(ActionEvent e) {
        String inputValue3=JOptionPane.showInputDialog("请输入新类型:") ;

        list3.add(inputValue3);
    }

    public void jButton12_actionPerformed(ActionEvent e) {
        String inputValue4=JOptionPane.showInputDialog("请输入新类型:") ;
        list4.add(inputValue4);
    }

    public void jButton7_actionPerformed(ActionEvent e) {
        int n;
        n=list1.getSelectedIndex();
        // System.out.print(n);
        if(n<0)
            JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
        else;
            list1.remove(n);
    }

    public void jButton8_actionPerformed(ActionEvent e) {
        int n;
        n=list2.getSelectedIndex();
        if(n<0)
            JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
        else
            list2.remove(n);

    }

    public void jButton9_actionPerformed(ActionEvent e) {
        int n;
        n = list3.getSelectedIndex();
        if (n < 0)
            JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",
                                          JOptionPane.YES_NO_OPTION,
                                          JOptionPane.QUESTION_MESSAGE);
        else
            list3.remove(n);

    }

    public void jButton11_actionPerformed(ActionEvent e) {
        int n;
        n = list4.getSelectedIndex();
        if (n < 0)
            JOptionPane.showConfirmDialog(null, "操作错误!无可删除项或无选择项", "确认",
                                          JOptionPane.YES_NO_OPTION,
                                          JOptionPane.QUESTION_MESSAGE);
        else
            list4.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 + -