📄 userpay.java
字号:
package smgpgw;
import java.io.*;
import java.util.*;
import javax.swing.*;
import java.awt.*;
import com.borland.jbcl.layout.*;
import java.awt.event.*;
import javax.swing.event.*;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2002
* Company:
* @author
* @version 1.0
*/
public class UserPay extends JDialog {
public boolean bFlag = false;
JPanel panUser = new JPanel();
XYLayout xYLayPay = new XYLayout();
JLabel jLabel1 = new JLabel();
JTextField txtTeleCode = new JTextField();
JTextField txtDestAddr = new JTextField();
JLabel jLabel2 = new JLabel();
JTextField txtInfo = new JTextField();
JLabel jLabel3 = new JLabel();
JButton btnCancel = new JButton();
JButton btnSend = new JButton();
public UserPay() {
try {
jbInit();
} catch(Exception e) {
e.printStackTrace();
}
setDlg();
}
private void setDlg() {
int nHostSize;
try {
nHostSize = SMSCConnectionManager.SmppHost.size();
} catch(Exception e) {
nHostSize = 0;
}
if(nHostSize <= 0)
btnSend.setEnabled(false);
else
btnSend.setEnabled(true);
}
private void jbInit() throws Exception {
btnCancel.setText("取消");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
btnCancel_actionPerformed(e);
}
}
);
jLabel3.setText("投注短信信息");
panUser.setLayout(xYLayPay);
this.setResizable(false);
this.setModal(true);
this.setTitle("用户投注");
jLabel1.setText("用户手机号码");
jLabel2.setText("目 的 地 址");
txtInfo.setHorizontalAlignment(SwingConstants.RIGHT);
txtDestAddr.setHorizontalAlignment(SwingConstants.RIGHT);
txtTeleCode.setHorizontalAlignment(SwingConstants.RIGHT);
panUser.setMaximumSize(new Dimension(296, 165));
panUser.setMinimumSize(new Dimension(296, 165));
panUser.setPreferredSize(new Dimension(272, 185));
btnSend.setText("投注");
btnSend.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
btnSend_actionPerformed(e);
}
}
);
xYLayPay.setWidth(272);
xYLayPay.setHeight(185);
this.getContentPane().add(panUser, BorderLayout.CENTER);
panUser.add(jLabel1, new XYConstraints(11, 10, 86, 28));
panUser.add(jLabel2, new XYConstraints(11, 47, 86, 28));
panUser.add(jLabel3, new XYConstraints(11, 83, 86, 28));
panUser.add(txtTeleCode, new XYConstraints(103, 10, 157, 28));
panUser.add(txtDestAddr, new XYConstraints(103, 47, 157, 28));
panUser.add(txtInfo, new XYConstraints(103, 83, 157, 28));
panUser.add(btnSend, new XYConstraints(198, 126, 62, -1));
panUser.add(btnCancel, new XYConstraints(103, 126, 62, -1));
}
void btnCancel_actionPerformed(ActionEvent e) {
bFlag = false;
dispose();
}
void btnSend_actionPerformed(ActionEvent e) {
int nHostSize = 0;
Enumeration firstHost = null;
Constants.nMsgNumber = 1;
Constants.nTimeInterval = 0;
Constants.nSendMode = Constants.NUMBER;
Constants.nMsgType = SmscConstants.SMPP_DELIVER_SM;
try {
nHostSize = SMSCConnectionManager.SmppHost.size();
} catch(Exception eSize) {
nHostSize = 0;
}
if(nHostSize == 0)
Constants.strDestAddr = "";
else {
firstHost = SMSCConnectionManager.SmppHost.elements();
Constants.strDestAddr = (String)firstHost.nextElement() + Constants.Receiver;
}
Constants.smscMsg.msgSourceAddress = txtTeleCode.getText();
Constants.smscMsg.msgDestAddress = txtDestAddr.getText();
Constants.smscMsg.msgShortMsgText = txtInfo.getText();
bFlag = true;
dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -