?? web158_com_operate.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_Com_Operate extends JPanel implements ActionListener
{
//
FlowLayout f_main=new FlowLayout();
//首行控格
JPanel top_space=new JPanel();
JPanel top_title=new JPanel();
//試題區
JTextPane txtinfo=new JTextPane();
//試題面板
JPanel txtinfo_back=new JPanel();
//按鈕
JPanel Button_Panel=new JPanel();
JButton button_last=new JButton(" 上一題 ");
JButton button_next=new JButton(" 下一題 ");
//標題
JLabel web158_com_title=new JLabel("操作題目: ");
//信息提示
JPanel top_info=new JPanel();
JTextPane top_info_text=new JTextPane();
Web158_Com_Operate()
{
initFont();
//初始化取試題面板大小
this.setPreferredSize(new Dimension(500,510));
//視題面板顯示背景
this.setOpaque(false);
//取試題標題
web158_com_title.setPreferredSize(new Dimension(500,25));
web158_com_title.setLayout(f_main);
web158_com_title.setFont(new Font("宋體",Font.PLAIN,14));
top_title.add(web158_com_title);
//添加標題
top_title.setPreferredSize(new Dimension(500,30));
top_title.setOpaque(false);
add(top_title);
//試題滾動區
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setPreferredSize(new Dimension(500,320));
scrollPane.setBorder(null);
//內容區
txtinfo.setBackground(new Color(207,207,157));
txtinfo.setEditable(false);
txtinfo.setText("哈哈");
txtinfo.setFont(new Font("宋體",Font.PLAIN,13));
scrollPane.setViewportView(txtinfo);
txtinfo_back.add(scrollPane);
//添加到面板
txtinfo_back.setPreferredSize(new Dimension(500,300));
txtinfo_back.setOpaque(false);
add(txtinfo_back);
//提示文字
final JScrollPane ext = new JScrollPane();
ext.setPreferredSize(new Dimension(500,320));
ext.setBorder(null);
top_info_text.setPreferredSize(new Dimension(480,60));
top_info_text.setForeground(new Color(90,45,11));
top_info_text.setFont(new Font("宋體",Font.PLAIN,14));
top_info_text.setText("操作題答案需存到D盤 myexam >>exam文件夾中并把exam文件夾打包成.rar文件以exam.rar命名后再提交試卷");
ext.setViewportView(top_info_text);
top_info.add(ext);
//添加信息提示
top_info.setPreferredSize(new Dimension(500,60));
top_info.setOpaque(false);
add(top_info);
//上一題目按鈕
button_last.setPreferredSize(new Dimension(70,25));
button_last.setBorder(null);
button_last.setBackground(new Color(207,207,157));
button_last.setCursor(new Cursor(Cursor.HAND_CURSOR));
button_last.setFont(new Font("宋體",Font.BOLD,14));
button_last.setToolTipText("點擊答上一題");
Button_Panel.add(button_last);
//下一題按鈕
button_next.setPreferredSize(new Dimension(70,25));
button_next.setBorder(null);
button_next.setBackground(new Color(207,207,157));
button_next.setCursor(new Cursor(Cursor.HAND_CURSOR));
button_next.setFont(new Font("宋體",Font.BOLD,14));
button_next.setToolTipText("點擊答下一題");
Button_Panel.add(button_next);
Button_Panel.setPreferredSize(new Dimension(400,300));
Button_Panel.setOpaque(false);
add(Button_Panel);
}
public void actionPerformed(ActionEvent e)
{
}
//字體
void initFont()
{
Font font = new Font("宋體",0,12);
UIManager.put("Label.font", font);
UIManager.put("Button.font", font);
UIManager.put("OptionPane.font", font);
UIManager.put("OptionPane.messageFont", font);
UIManager.put("OptionPane.buttonFont", font);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -