【Java开源代码栏目提醒】:网学会员Java开源代码为您提供SMSSet.java参考,解决您在SMSSet.java学习中工作中的难题,参考学习。
package ch15.sms;
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class SMSSet extends JDialog implements ActionListener {
private JPanel panel1 = new JPanel();
private BorderLayout borderLayout1 = new BorderLayout();
private JPanel jPanel1 = new JPanel();
private JTabbedPane jTabbedPane1 = new JTabbedPane();
private JPanel jPanel2 = new JPanel();
private JPanel jPanel3 = new JPanel();
private JButton jButton1 = new JButton();
private JButton jButton2 = new JButton();
private TitledBorder titledBorder1 = new TitledBorder("通信端口");
private JLabel jLabel1 = new JLabel();
private JComboBox jComboBox1 = new JComboBox();
private JLabel jLabel2 = new JLabel();
private JLabel jLabel3 = new JLabel();
private JComboBox jComboBox2 = new JComboBox();
private JComboBox jComboBox3 = new JComboBox();
private JLabel jLabel4 = new JLabel();
private JComboBox jComboBox4 = new JComboBox();
private JLabel jLabel5 = new JLabel();
private JComboBox jComboBox5 = new JComboBox();
private JLabel jLabel6 = new JLabel();
private JComboBox jComboBox6 = new JComboBox();
private JButton jButton3 = new JButton();
private TitledBorder titledBorder2 = new TitledBorder("常规设置");
private JLabel jLabel7 = new JLabel();
private JTextField jTextField1 = new JTextField();
private JLabel jLabel8 = new JLabel();
private JComboBox jComboBox7 = new JComboBox();
private JLabel jLabel9 = new JLabel();
private JTextField jTextField2 = new JTextField();
private JLabel jLabel10 = new JLabel();
private JComboBox jComboBox8 = new JComboBox();
private JLabel jLabel11 = new JLabel();
public SMSSet(Frame owner, String title, boolean modal) {
super(owner, title, modal);
try {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jbInit();
pack();
} catch (Exception exception) {
exception.printStackTrace();
}
}
public SMSSet() {
this(new Frame(), "SMSSet", false);
}
private void jbInit() throws Exception {
panel1.setLayout(borderLayout1);
jPanel1.setLayout(null);
jTabbedPane1.setBounds(new Rectangle(0, 3, 434, 284));
jButton1.setBounds(new Rectangle(168, 298, 93, 31));
jButton1.setToolTipText("");
jButton1.setText("确定");
jButton1.addActionListener(this);
jButton2.setBounds(new Rectangle(276, 298, 86, 30));
jButton2.setText("取消");
jButton2.addActionListener(this);
jPanel2.setBorder(titledBorder1);
jPanel2.setLayout(null);
jLabel1.setToolTipText("");
javax.swing.DefaultComboBoxModel com1 = new DefaultComboBoxModel();
com1.addElement("COM1");
com1.addElement("COM2");
jLabel1.setText("通信端口");
jLabel1.setBounds(new Rectangle(12, 23, 83, 23));
jComboBox1.setBounds(new Rectangle(110, 19, 147, 23));
jComboBox1.setModel(com1);
javax.swing.DefaultComboBoxModel com = new DefaultComboBoxModel();
com.addElement("9600");
com.addElement("2400");
com.addElement("300");
com.addElement("14400");
com.addElement("28800");
com.addElement("38400");
com.addElement("57600");
com.addElement("152000");
jLabel2.setToolTipText("");
jLabel2.setText("波特率");
jLabel2.setBounds(new Rectangle(12, 57, 50, 16));
jLabel3.setToolTipText("");
jLabel3.setText("数据位");
jLabel3.setBounds(new Rectangle(12, 87, 51, 14));
jComboBox2.setBounds(new Rectangle(110, 49, 147, 23));
jComboBox2.setModel(com);
jComboBox3.setBounds(new Rectangle(110, 79, 147, 23));
javax.swing.DefaultComboBoxModel com3 = new DefaultComboBoxModel();
com3.addElement("8");
com3.addEleme