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

📄 web158_getquestion.java

📁 java socket 网上在线考试系统
💻 JAVA
字号:
package web158.com;
/**
 * @param 李建东
 * 
 * 联系电话:0898-62925341
 * 
 * 联系QQ:813751  657597  8912740
 * 
 * 网   址:
 * 			http://www.web156.com
 *			http://www.web158.com
 */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Web158_SGetQuestion extends JPanel implements ActionListener
{
	//
	FlowLayout f_main=new FlowLayout();
	//首行控格
	JPanel top_space=new JPanel();
	JPanel top_title=new JPanel();
	//服务器
	JPanel top_host=new JPanel();
	JLabel top_host_text=new JLabel("服务器地址:");
	final JTextField top_host_input=new JTextField();
	//端口号
	JPanel top_port=new JPanel();
	JLabel top_port_text=new JLabel("服务器端口:");
	final JTextField top_port_input=new JTextField();
//	端口号
	JPanel top_name=new JPanel();
	JLabel top_name_text=new JLabel("考生姓名:");
	final JTextField top_name_input=new JTextField();
//	端口号
	JPanel top_id=new JPanel();
	JLabel top_id_text=new JLabel("准考证号:");
	final JTextField top_id_input=new JTextField();
	//按钮
	JPanel top_button=new JPanel();
	JButton top_button_ok=new JButton("领取试题");
	JButton top_button_cancle=new JButton("退出系统");
	//标题
	JLabel web158_com_title=new JLabel("考生领取试题 ");
	//开始考试系统
	JButton top_begin=new JButton("开始答题");
	//信息提示
	JPanel top_info=new JPanel();
	JLabel top_info_text=new JLabel();
	Web158_SGetQuestion()
	{
		//初始化取试题面板大小
		this.setPreferredSize(new Dimension(500,510));
		//视题面板显示背景
		this.setOpaque(false);
		//f_main.setAlignment(0);
		top_space.setPreferredSize(new Dimension(500,40));
		top_space.setOpaque(false);
		add(top_space);
		//取试题标题
		web158_com_title.setPreferredSize(new Dimension(400,50));
		web158_com_title.setLayout(f_main);
		top_title.add(web158_com_title);
		//添加标题
		top_title.setPreferredSize(new Dimension(500,50));
		top_title.setOpaque(false);
		add(top_title);
		
		//服务器标题表彰添加到面板
		top_host_text.setPreferredSize(new Dimension(70,30));
		top_host.add(top_host_text);
		top_host_input.setPreferredSize(new Dimension(120,18));
		top_host_input.setBorder(BorderFactory.createLineBorder(new Color(200,125,140)));
		top_host_input.setToolTipText("请填写考试服务器地址,可以以域名方式,也可以用IP地址方式");
		top_host.add(top_host_input);
		//添加服务器
		top_host.setPreferredSize(new Dimension(500,60));
		top_host.setOpaque(false);
		add(top_host);
		
		//服务器标题表彰添加到面板
		top_port_text.setPreferredSize(new Dimension(70,30));
		top_port.add(top_port_text);
		top_port_input.setPreferredSize(new Dimension(120,18));
		top_port_input.setBorder(BorderFactory.createLineBorder(new Color(200,125,140)));
		top_port_input.setToolTipText("请填写考试服务器端口,不能大于10000");
		top_port.add(top_port_input);
		//添加服务器端口
		top_port.setPreferredSize(new Dimension(500,60));
		top_port.setOpaque(false);
		add(top_port);
		
		//考生姓名
		top_name_text.setPreferredSize(new Dimension(70,30));
		top_name.add(top_name_text);
		top_name_input.setPreferredSize(new Dimension(120,18));
		top_name_input.setBorder(BorderFactory.createLineBorder(new Color(200,125,140)));
		top_name_input.setToolTipText("请填写您的姓名");
		top_name.add(top_name_input);
		//添加服务器端口
		top_name.setPreferredSize(new Dimension(500,60));
		top_name.setOpaque(false);
		add(top_name);
		
		//考生考号
		top_id_text.setPreferredSize(new Dimension(70,30));
		top_id.add(top_id_text);
		top_id_input.setPreferredSize(new Dimension(120,18));
		top_id_input.setBorder(BorderFactory.createLineBorder(new Color(200,125,140)));
		top_id_input.setToolTipText("请填写您的准考证号码");
		top_id.add(top_id_input);
		//添加服务器端口
		top_id.setPreferredSize(new Dimension(500,60));
		top_id.setOpaque(false);
		add(top_id);
		
		//信息面板
		top_button_ok.setPreferredSize(new Dimension(70,18));
		top_button_ok.setBorder(null);
		top_button_ok.setBackground(new Color(207,207,157));
		top_button_ok.setCursor(new Cursor(Cursor.HAND_CURSOR));
		top_button.add(top_button_ok);
		//添加取消按钮
		top_button_cancle.setPreferredSize(new Dimension(70,18));
		top_button_cancle.setBorder(null);
		top_button_cancle.setBackground(new Color(207,207,157));
		top_button_cancle.setCursor(new Cursor(Cursor.HAND_CURSOR));
		top_button.add(top_button_cancle);
		
		//开始答题按钮
		top_begin.setText("开始答题");
		top_begin.setFont(new Font("宋体",Font.BOLD,14));
		top_begin.setPreferredSize(new Dimension(120,35));
		top_begin.setCursor(new Cursor(Cursor.HAND_CURSOR));
		top_begin.setBackground(new Color(207,207,157));
		top_begin.setBorder(null);
		top_begin.setFocusable(false);
		top_begin.setVisible(false);
		top_button.add(top_begin);
		//添加服务器端口
		top_button.setPreferredSize(new Dimension(500,60));
		top_button.setOpaque(false);
		add(top_button);
		
		top_info_text.setPreferredSize(new Dimension(400,30));
		top_info_text.setForeground(new Color(90,45,11));
		top_info.add(top_info_text);
		
		//添加信息提示
		top_info.setPreferredSize(new Dimension(500,60));
		top_info.setOpaque(false);
		add(top_info);
	}
	public void actionPerformed(ActionEvent e)
	{
		
	}
}

⌨️ 快捷键说明

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