package codegame;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import codegame.utils.Frame;
public class CodeGame extends Frame {
private Text sourceText;
private Button runButton;
private Text consoleText;
private Button nextButton;
private Text answerText;
private Label resultLabel;
private Button commitButton;
private Button preButton;
private Text roundText;
private Button gotoButton;
public CodeGame() {
super("代码小游戏", 700, 800);
}
@Override
protected void init() {
shell.setLayout(new GridLayout(1, false));
Composite sourceComposite = new Composite(shell, SWT.NONE);
sourceText = new Text(sourceComposite, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
sourceText.setBounds(0, 0, 650, 270);
Composite consoleLabelComposite = new Composite(shell, SWT.NONE);
consoleLabelComposite.setLayout(new FillLayout());
runButton = new Button(consoleLabelComposite, SWT.PUSH);
runButton.setText("查看答案");
preButton = new Button(consoleLabelComposite, SWT.PUSH);
preButton.setText("上一关");
nextButton = new Button(consoleLabelComposite, SWT.PUSH);
nextButton.setText("下一关");
roundText = new Text(consoleLabelComposite, SWT.SINGLE | SWT.BORDER);
//roundText.setText(" ");
gotoButton = new Button(consoleLabelComposite, SWT.PUSH);
gotoButton.setText("跳关");
// Composite consoleTextComposite = new Composite(shell, SWT.NONE);
//
// consoleText = new Text(consoleTextComposite, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
// consoleText.setBounds(0, 0, 650, 100);
// consoleText.setEditable(false);
Composite answerComposite = new Composite(shell, SWT.NONE);
answerText = new Text(answerComposite, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
answerText.setBounds(0, 0, 650, 100);
Composite commitComposite = new Composite(shell, SWT.NONE);
commitComposite.setLayout(new GridLayout(2, false));
commitButton = new Button(commitComposite, SWT.PUSH);
commitButton.setText("提交");
resultLabel = new Label(commitComposite, SWT.NONE);
resultLabel.setText(ToolTipConstents.CONSOLE_OUTPUT_TIP);
Compiler compiler = new Compiler(this);
}
public static void main(String[] args) {
new CodeGame();
}
public Text getSourceText() {
return sourceText;
}
public void setSourceText(Text sourceText) {
this.sourceText = sourceText;
}
public Button getRunButton() {
return runButton;
}
public void setRunButton(Button runButton) {
this.runButton = runButton;
}
public Text getConsoleText() {
return consoleText;
}
public void setConsoleText(Text consoleText) {
this.consoleText = consoleText;
}
public Button getNextButton() {
return nextButton;
}
public void setNextButton(Button nextButton) {
this.nextButton = nextButton;
}
public Text getAnswerText() {
return answerText;
}
public void setAnswerText(Text answerText) {
this.answerText = answerText;
}
public Label getResultLabel() {
return resultLabel;
}
public void setResultLabel(Label resultLabel) {
this.resultLabel = resultLabel;
}
public Button getCommitButton() {
return commitButton;
}
public void setCommitButton(Button commitButton) {
this.commitButton = commitButton;
}
public Button getPreButton() {
return preButton;
}
public void setPreButton(Button preButton) {
this.preButton = preButton;
}
public Text getRoundText() {
return roundText;
}
public void setRoundText(Text roundText) {
this.roundText = roundText;
}
public Button getGotoButton() {
return gotoButton;
}
public void setGotoButton(Button gotoButton) {
this.gotoButton = gotoButton;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
一个桌面程序,通过游戏闯关的方式来了解一些java的语言细节。.zip
共55个文件
java:13个
jar:5个
xml:4个
0 下载量 15 浏览量
2023-09-11
10:01:50
上传
评论
收藏 3.82MB ZIP 举报
温馨提示
用java写的项目,项目可以直接运行,请放心下载使用。
资源推荐
资源详情
资源评论
收起资源包目录
一个桌面程序,通过游戏闯关的方式来了解一些java的语言细节。.zip (55个子文件)
63
lib
org.eclipse.core.runtime_3.12.0.v20160606-1342.jar 74KB
org.eclipse.swt.win32.win32.x86_64_3.105.0.v20160603-0902.jar 2.74MB
org.eclipse.core.commands_3.8.0.v20160316-1921.jar 112KB
org.eclipse.equinox.common_3.8.0.v20160509-1230.jar 118KB
org.eclipse.jface_3.12.0.v20160518-1929.jar 1.04MB
.settings
org.eclipse.jdt.core.prefs 658B
org.eclipse.core.resources.prefs 298B
src
codegame
Compiler.java 3KB
ToolTipConstents.java 343B
utils
compile
DynaCompUtil.java 492B
ClassFileManager.java 1003B
DynamicEngine.java 4KB
DynamicClassLoader.java 757B
JavaClassObject.java 921B
DynaCompTest.java 896B
CharSequenceJavaFileObject.java 749B
TextFile.java 2KB
ResourceUtil.java 548B
Frame.java 531B
CodeGame.java 4KB
.idea
libraries
lib.xml 257B
vcs.xml 167B
misc.xml 215B
encodings.xml 426B
sources
021 119B
013 107B
029 113B
024 126B
006 158B
022 183B
023 129B
014 231B
001 97B
015 246B
004 155B
012 172B
017 233B
010 155B
016 79B
007 98B
020 89B
008 356B
002 194B
027 782B
025 82B
005 138B
026 189B
019 602B
003 158B
009 354B
028 230B
030 133B
011 142B
018 244B
.gitignore 6B
共 55 条
- 1
资源评论
c++服务器开发
- 粉丝: 3047
- 资源: 4462
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功