Exemple #1
0
  @Override
  public void renderPanel(Graphics gfx, Panel w) {
    int x = w.getAbsoluteX();
    int y = w.getAbsoluteY();
    // TODO translate into widgets render() method

    gfx.setColor(backColor1);
    gfx.fillRect(x, y, w.getWidth(), w.getHeight());
    gfx.setColor(borderColor);
    gfx.setLineWidth(2);
    gfx.drawRect(x, y, w.getWidth(), w.getHeight());
  }
 private Point updateTargetLocation() {
   return new Point(
       target.getLocationOnScreen().x + target.getWidth() / 2,
       target.getLocationOnScreen().y + target.getHeight() / 2);
 }