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

📄 validate03.java

📁 本工程模拟网上社区,其中包括银行,软件销售公司,软件投资公司,茶餐馆,和多个服务器.
💻 JAVA
字号:
package investcompanyclient;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.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;public class validate03 extends javax.swing.JFrame {	private JLabel jLabel1;	private JLabel jLabel2;	private JButton jButton2;	private JButton jButton1;	private JPasswordField jPasswordField1;	private JTextField jTextField1;	private BufferedReader in;	private Socket socket;	private PrintWriter out;	private String _bidder;	public validate03(Socket s) {		super();		socket = s;				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 {						getContentPane().setLayout(null);			this.setTitle("\u9a8c\u8bc1\u4e2d");			this.setLocation(new java.awt.Point(400, 180));			{				jLabel1 = new JLabel();				getContentPane().add(jLabel1);				jLabel1.setText("\u7528\u6237\uff1a");				jLabel1.setBounds(45, 102, 87, 29);			}			{				jTextField1 = new JTextField();				getContentPane().add(jTextField1);				jTextField1.setBounds(190, 100, 210, 33);			}			{				jLabel2 = new JLabel();				getContentPane().add(jLabel2);				jLabel2.setText("\u5bc6\u7801\uff1a");				jLabel2.setBounds(45, 189, 71, 32);			}			{				jPasswordField1 = new JPasswordField();				getContentPane().add(jPasswordField1);				jPasswordField1.setBounds(190, 189, 219, 27);			}			{				jButton1 = new JButton();				getContentPane().add(jButton1);				jButton1.setText("\u786e\u5b9a");				jButton1.setBounds(86, 300, 92, 39);				jButton1.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						jButton1ActionPerformed(evt);					}				});			}			{				jButton2 = new JButton();				getContentPane().add(jButton2);				jButton2.setText("\u53d6\u6d88");				jButton2.setBounds(232, 300, 77, 39);				jButton2.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						jButton2ActionPerformed(evt);					}				});			}			pack();			this.setSize(466, 439);		} 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 = "validate" + "/" + 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++;				}				out.println("bidhandle"+"/"+t[1]);				this.setVisible(false);				Bidhandle hf = new Bidhandle(socket, t[1]);				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 + -