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

📄 validate02.java

📁 本工程模拟网上社区,其中包括银行,软件销售公司,软件投资公司,茶餐馆,和多个服务器.
💻 JAVA
字号:
package investcompanyclient;import java.awt.BorderLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPasswordField;import javax.swing.JTextField;import javax.swing.WindowConstants;import javax.swing.SwingUtilities;import java.net.*;import java.io.*;import javax.swing.*;import java.util.*;import java.awt.*;public class validate02 extends javax.swing.JFrame {	private JLabel jLabel1;	private JLabel jLabel2;	private JButton jButton2;	private JButton jButton1;	private JPasswordField jPasswordField1;	private JTextField jTextField1;	private Socket socket;	private BufferedReader in;	private PrintWriter out;    private String st;    private String sn;		public validate02(Socket s,String t,String sn) {		super();		socket = s;		this.sn = sn;		st= t;		try {			in = new BufferedReader(new InputStreamReader(socket					.getInputStream()));			out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(					socket.getOutputStream())), true);		} catch (IOException e) {			System.out.println(e);		}		initGUI();	}		private void initGUI() {		try {			//setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);			this.setTitle("\u9a8c\u8bc1\u4e2d:::");			getContentPane().setLayout(null);			this.setLocation(new java.awt.Point(400, 180));			{				jLabel1 = new JLabel();				getContentPane().add(jLabel1);				jLabel1.setText("\u7528\u6237\u540d\uff1a");				jLabel1.setBounds(31, 61, 48, 31);			}			{				jTextField1 = new JTextField();				getContentPane().add(jTextField1);				jTextField1.setBounds(155, 59, 181, 35);			}			{				jLabel2 = new JLabel();				getContentPane().add(jLabel2);				jLabel2.setText("\u5bc6\u7801\uff1a");				jLabel2.setBounds(31, 141, 48, 28);			}			{				jPasswordField1 = new JPasswordField();				getContentPane().add(jPasswordField1);				jPasswordField1.setBounds(155, 141, 181, 22);			}			{				jButton1 = new JButton();				getContentPane().add(jButton1);				jButton1.setText("\u786e\u5b9a");				jButton1.setBounds(69, 229, 86, 22);				jButton1.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						jButton1ActionPerformed(evt);					}				});			}			{				jButton2 = new JButton();				getContentPane().add(jButton2);				jButton2.setText("\u53d6\u6d88");				jButton2.setBounds(204, 229, 90, 22);				jButton2.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						jButton2ActionPerformed(evt);					}				});			}			pack();			this.setSize(388, 330);		} catch (Exception e) {			e.printStackTrace();		}	}	private void jButton2ActionPerformed(ActionEvent evt) {		 this.dispose();         this.setVisible(false);	}	private void jButton1ActionPerformed(ActionEvent evt) {		try {			String id = jTextField1.getText();			String code = new String(jPasswordField1.getPassword());			String temp = "validate02" + "/" + id + "/" + code; 			out.println(temp);			out.flush();			String ans = in.readLine();			if (!ans.equals("false")) {				StringTokenizer stn = new StringTokenizer(ans.trim(), "/");				String[] t = { " ", " ", " ", " ", " ", " " };				int i = 0;				while (stn.hasMoreTokens()) {					t[i] = stn.nextToken();					i++;				}				this.setVisible(false);				bidFrame  hf = new bidFrame(socket,t[1],st,sn);				hf.setVisible(true);			} else {				JOptionPane.showMessageDialog(null, "你无权进行竞标!");				jTextField1.setText("");				jPasswordField1.setText("");			}		} catch (IOException e) {			System.out.println(e);		}             	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -