Draws this rectangle using the AWT drawing API. Required to implement the Drawable interface. @param panel DrawingPanel @param g Graphics
(DrawingPanel panel, Graphics g)
| 42 | * @param g Graphics |
| 43 | */ |
| 44 | @Override |
| 45 | public void draw(DrawingPanel panel, Graphics g) { |
| 46 | // this method implements the Drawable interface |
| 47 | g.setColor(Color.RED); // set drawing color to red |
| 48 | g.fillRect(left, top, width, height); // draws rectangle |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /* |