?? web158_getquestion.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 + -