📄 questionpanel.java
字号:
package exam.gui;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import exam.model.Question;
/**
* 显示一道试题的面板
*
* @author teacher
*
*/
public class QuestionPanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = -3235963662881001526L;
private JScrollPane jsp;
private Question question;
private JTextArea text;
public QuestionPanel(final Question question) {
this.question = question;
text = new JTextArea(100, 56);
jsp = new JScrollPane(text);
this.add(jsp);
// this.add(text);
init();
}
private void init() {
text.setLineWrap(true);
text.append(question.getId() + "," + question.getTitle() + "\n");
text.append("A:" + question.getAnswerA() + "\n");
text.append("B:" + question.getAnswerB() + "\n");
text.append("C:" + question.getAnswerC() + "\n");
text.append("D:" + question.getAnswerD() + "\n");
text.setEditable(false);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -