selfaddingovalbad.java
来自「Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套」· Java 代码 · 共 24 行
JAVA
24 行
// Figure 15.4/** Note that this class relies upon a specific kind of Driver class, * and is an inferior design than the original Oval class. * A better alternative is shown in Figure 15.5 */public class SelfAddingOvalBad extends Oval { /** pre: The Driver class must include a public, static * variable, called window, of type JFrame * and window != null <br> * post: this is instantiated * and getX() == x and getY() == y * and getWidth() == w and getHeight() == h * and getParent() == window.getContentPane() */ public SelfAddingOvalBad(int x, int y, int w, int h ) { super(x, y, w, h); Driver.window.add(this, 0); repaint(); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?