?? rubiksimul.java
字號:
import java.awt.*;
import java.applet.Applet;
public class RubikSimul extends Applet {
RubikCube R;
public Color getBackground() {
return Color.lightGray;
}
public void init() {
add (new Button ("Grundstellung"));
R = new RubikCube();
}
public Dimension preferredSize () {
// definiert in Basisklasse Component, wird vom Layout-Manager verwendet
return Prj.preferredSize ();
}
public boolean mouseDown (Event evt, int x, int y) {
R.onMouseClick (x, y);
R.paint (getGraphics());
return true;
}
public boolean mouseMove (Event evt, int x, int y) {
Graphics g = getGraphics();
R.onMouseMove (g, x, y);
return true;
}
public boolean action (Event evt, Object arg) {
if ("Grundstellung".equals(arg)) {
R.reset();
R.paint (getGraphics());
return true;
}
return false;
}
public void paint (Graphics g) {
R.paint (g);
}
public String getAppletInfo() {
return "Rubik-Simulator (H.R.)";
}
/*** nur fuer die Application-Version:
public static void main (String args[]) {
AppletFrame.startApplet ("RubikSimul", "Rubik-Simulator");
}
***/
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -