?? animatingsurface.java~2~
字號:
package java2d;/** * Demos that animate extend this class. */public abstract class AnimatingSurface extends Surface implements Runnable { public Thread thread; public abstract void step(int w, int h); public abstract void reset(int newwidth, int newheight); public void start() { if (thread == null) { thread = new Thread(this); thread.setPriority(Thread.MIN_PRIORITY); thread.setName(name + " Demo"); thread.start(); } } public synchronized void stop() { if (thread != null) { thread.interrupt(); } thread = null; max = (float) 0.0; notifyAll(); } public void run() { Thread me = Thread.currentThread(); while (thread == me && !isShowing() || getSize().width == 0) { try { thread.sleep(500); } catch (InterruptedException e) {} } while (thread == me) { repaint(); try { thread.sleep(500); } catch (InterruptedException e) {} } thread = null; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -