package com.ui;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
public class AdminView extends JFrame {
private JLabel jlQueryWarn;
private JLabel jlnewWarn;
private JLabel jlQuWarn;
private JLabel jlcunWarn;
private JLabel jloldWarn;
private ButtonGroup osavingTypeGroup = new ButtonGroup();
private ButtonGroup ocurTypeGroup = new ButtonGroup();
private ButtonGroup cunTypeGroup = new ButtonGroup();
private ButtonGroup huobiTypeGroup = new ButtonGroup();
private ButtonGroup openAccountGroup = new ButtonGroup();
private ButtonGroup sexGroup = new ButtonGroup();
private ButtonGroup customerGroup = new ButtonGroup();
private CardLayout cardLayout = new CardLayout();
JTextField jtfName;
JTextField jtfId;
JRadioButton jrbNewCustomer;
JTextField jtfTel;
JTextField jtfAddress;
JRadioButton jrbOpenYes;
JTextField jtfPassword;
JRadioButton jrbRMB;
JRadioButton jrbHuo;
JTextField jtfMoney;
JButton jbsubmit;
JButton jbreset;
JRadioButton jrbMale;
JTextField jtfXCustomerName;
JButton jbnDeleteAccount;
JButton jbnSrearch;
JTable jtbCustomers;
JTable jtbAccounts;
JButton jbnDelCustomer;
private Object[] userCols = new Object[] { "用户名", "身份证", "性别", "联系电话", "联系地址" };
private Object[] accountCols = new Object[] { "卡号", "货币类型", "存款类型", "开户日期", "开户金额","金额","是否挂失" };
JScrollPane jspCustomers;
JScrollPane jspAccounts;
JTextField jtfCCardId;
JPasswordField jtfCPassword;
JTextField jtfCSPassword;
JTextField jtfCMoney;
JButton jbnCun;
JTextField jtfQcardId;
JPasswordField jtfQpassword;
JPasswordField jtfQSpassword;
JTextField jtfQmoney;
JButton jbnQu;
JTextField jtfOPID;
JTextField jtfOpassword;
JRadioButton jrbORMB ;
JRadioButton jrbODollar;
JRadioButton jrbOhuo;
JRadioButton jrbOdin;
JTextField jtfOopenMoney;
JButton jbnOsubmit;
JButton jbnOreset;
/**
* Launch the application
*
* @param args
*/
public static void main(String args[]) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
AdminView frame = new AdminView();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame
*/
public AdminView() {
super("管理员操作界面");
setBounds(100, 100, 595, 510);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
initialize();
}
private void initialize() {
getContentPane().setLayout(new BorderLayout());
final JTabbedPane tabbedPane = new JTabbedPane();
getContentPane().add(tabbedPane, BorderLayout.CENTER);
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
tabbedPane.addTab("开户", null, panel, null);
final JPanel panel_4 = new JPanel();
panel_4.setLayout(new FlowLayout());
panel.add(panel_4, BorderLayout.NORTH);
jrbNewCustomer = new JRadioButton();
jrbNewCustomer.setSelected(true);
customerGroup.add(jrbNewCustomer);
jrbNewCustomer.setText("新客户");
panel_4.add(jrbNewCustomer);
final JRadioButton jrbOldCustomer = new JRadioButton();
customerGroup.add(jrbOldCustomer);
jrbOldCustomer.setText("旧客户");
panel_4.add(jrbOldCustomer);
final JPanel openAccountCenterPanel = new JPanel();
openAccountCenterPanel.setLayout(cardLayout);
panel.add(openAccountCenterPanel, BorderLayout.CENTER);
final JPanel newCustomerPanel = new JPanel();
newCustomerPanel.setLayout(null);
newCustomerPanel.setName("panel_6");
openAccountCenterPanel
.add(newCustomerPanel, newCustomerPanel.getName());
final JPanel panel_5 = new JPanel();
panel_5.setLayout(null);
panel_5.setBounds(0, 0, 578, 231);
newCustomerPanel.add(panel_5);
final JLabel label = new JLabel();
label.setText("客户名:");
label.setBounds(40, 15, 60, 15);
panel_5.add(label);
jtfName = new JTextField();
jtfName.setBounds(100, 10, 90, 22);
panel_5.add(jtfName);
final JLabel label_1 = new JLabel();
label_1.setText("性别:");
label_1.setBounds(43, 36, 36, 15);
panel_5.add(label_1);
jrbMale = new JRadioButton();
jrbMale.setSelected(true);
sexGroup.add(jrbMale);
jrbMale.setText("男");
jrbMale.setBounds(102, 34, 46, 19);
panel_5.add(jrbMale);
final JRadioButton jrbFemale = new JRadioButton();
sexGroup.add(jrbFemale);
jrbFemale.setText("女");
jrbFemale.setBounds(154, 34, 46, 19);
panel_5.add(jrbFemale);
final JLabel label_2 = new JLabel();
label_2.setText("身份证:");
label_2.setBounds(43, 74, 60, 15);
panel_5.add(label_2);
jtfId = new JTextField();
jtfId.setBounds(102, 71, 90, 22);
panel_5.add(jtfId);
final JLabel label_2_1 = new JLabel();
label_2_1.setText("电话:");
label_2_1.setBounds(43, 110, 60, 15);
panel_5.add(label_2_1);
jtfTel = new JTextField();
jtfTel.setBounds(102, 107, 90, 22);
panel_5.add(jtfTel);
final JLabel label_2_2 = new JLabel();
label_2_2.setText("地址:");
label_2_2.setBounds(43, 147, 60, 15);
panel_5.add(label_2_2);
jtfAddress = new JTextField();
jtfAddress.setBounds(102, 144, 90, 22);
panel_5.add(jtfAddress);
final JLabel label_2_2_1 = new JLabel();
label_2_2_1.setText("是否立即开户:");
label_2_2_1.setBounds(40, 185, 108, 15);
panel_5.add(label_2_2_1);
jrbOpenYes = new JRadioButton();
openAccountGroup.add(jrbOpenYes);
jrbOpenYes.setSelected(true);
jrbOpenYes.setText("是");
jrbOpenYes.setBounds(169, 183, 46, 19);
panel_5.add(jrbOpenYes);
final JRadioButton jrbOpenNo = new JRadioButton();
openAccountGroup.add(jrbOpenNo);
jrbOpenNo.setText("否");
jrbOpenNo.setBounds(221, 183, 46, 19);
panel_5.add(jrbOpenNo);
jlnewWarn = new JLabel();
jlnewWarn.setForeground(new Color(255, 0, 0));
jlnewWarn.setFont(new Font("", Font.BOLD, 12));
jlnewWarn.setText("");
jlnewWarn.setBounds(232, 72, 108, 18);
panel_5.add(jlnewWarn);
final JPanel panel_6 = new JPanel();
panel_6.setLayout(null);
panel_6.setBounds(0, 230, 578, 185);
newCustomerPanel.add(panel_6);
final JLabel label_3 = new JLabel();
label_3.setText("密码:");
label_3.setBounds(39, 10, 60, 15);
panel_6.add(label_3);
jtfPassword = new JTextField();
jtfPassword.setBounds(98, 7, 90, 22);
panel_6.add(jtfPassword);
final JLabel label_1_1 = new JLabel();
label_1_1.setText("货币类型:");
label_1_1.setBounds(39, 47, 60, 15);
panel_6.add(label_1_1);
jrbRMB = new JRadioButton();
huobiTypeGroup.add(jrbRMB);
jrbRMB.setSelected(true);
jrbRMB.setText("人民币");
jrbRMB.setBounds(98, 45, 79, 19);
panel_6.add(jrbRMB);
final JRadioButton jrbMeiYuan = new JRadioButton();
huobiTypeGroup.add(jrbMeiYuan);
jrbMeiYuan.setText("美元");
jrbMeiYuan.setBounds(183, 45, 81, 19);
panel_6.add(jrbMeiYuan);
final JLabel label_1_2 = new JLabel();
label_1_2.setText("存款类型:");
label_1_2.setBounds(39, 84, 60, 15);
panel_6.add(label_1_2);
jrbHuo = new JRadioButton();
cunTypeGroup.add(jrbHuo);
jrbHuo.setSelected(true);
jrbHuo.setText("活期");
jrbHuo.setBounds(98, 82, 79, 19);
panel_6.add(jrbHuo);
final JRadioButton jrbDin = new JRa