package four;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import lombok.Data;

/**
 * 登录面板,登录成功即跳转页面到客户端
 * 
 * @author czx
 *
 */
@Data
public class Coon {

	private JFrame frame;
	private JTextField textField;
	private JTextField textField_1;
	String host;
	int port;
	String cm;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Coon window = new Coon();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Coon() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setTitle("");
		frame.setBounds(100, 100, 448, 156);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.NORTH);

		JLabel lblNewLabel = new JLabel("\u8FDE\u63A5\u4FE1\u606F");
		panel.add(lblNewLabel);

		textField = new JTextField();
		textField.setText("127.0.0.1");
		panel.add(textField);
		textField.setColumns(10);

		textField_1 = new JTextField();
		textField_1.setText("10086");
		panel.add(textField_1);
		textField_1.setColumns(5);

		JButton btnNewButton = new JButton("\u8FDE\u63A5");
		btnNewButton.addActionListener(new ActionListener() {
			@SuppressWarnings("unused")
			public void actionPerformed(ActionEvent e) {
				
				host = textField.getText();
				cm = textField_1.getText();
				
				if (host != null && cm != null) {
					port = Integer.valueOf(cm);
					VoteClient vc = new VoteClient(host, port);
					frame.dispose();
				}
			}
		});
		panel.add(btnNewButton);
	}
}
最近下载更多
求学的熊猫  LV7 2023年12月26日
微信网友_5973767083364352  LV1 2022年5月25日
微信网友_5927360927125504  LV1 2022年4月22日
543666826  LV33 2022年3月12日
William2342  LV1 2022年2月8日
lllayc  LV1 2022年1月3日
Thynpa  LV1 2021年12月23日
1095402829  LV18 2021年12月15日
Derrick  LV1 2021年12月15日
Undead  LV2 2021年12月14日
最近浏览更多
akittyboy  LV9 3月22日
wananall  LV13 3月13日
laishaofe  LV7 1月16日
求学的熊猫  LV7 2023年12月25日
lshlsh 2023年12月25日
暂无贡献等级
shiaomon 2023年12月14日
暂无贡献等级
嗯嗯嗯嗯嗯嗯2528 2023年11月29日
暂无贡献等级
ftc1314  LV12 2023年11月2日
2017143155  LV12 2023年6月23日
2057889678 2023年6月8日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友