public void paint(Graphics g) {
    if (g == null)
      return;

    if (image == null) {
      image = canvas.createImage(IMG_TOTWIDTH, IMG_TOTHEIGHT);
      g2 = image.getGraphics();
      g2.setFont(new Font("Monospaced", Font.PLAIN, 11));
    }

    if (crtImage == null) {
      crtImage = new BufferedImage(displayWidth, displayHeight,
          BufferedImage.TYPE_INT_ARGB);
      Graphics gcrt = crtImage.getGraphics();
      gcrt.setColor(TRANSPARENT_BLACK);
      for (int i = 0, n = displayHeight; i < n; i += 2) {
        gcrt.drawLine(0, i, displayWidth, i);
      }
    }

    // Why is there transparency?
    g2.drawImage(screen, 0, 0,  null);

    if (reset > 0) {
      g2.setColor(darks[colIndex]);
      int xp = 44;
      if (reset < 44) {
        xp = reset;
      }
      g2.drawString("JaC64 " + version + " - Java C64 - www.jac64.com",
          xp + 1, 9);
      g2.setColor(lites[colIndex]);
      g2.drawString("JaC64 " + version + " - Java C64 - www.jac64.com",
          xp, 8);
      reset--;
    } else {
      String msg = "JaC64 ";
      if ((message != null) && (message != "")) {
        msg += message;
      } else {
        colIndex = 0;
      }
      msg += tmsg;

      g2.setColor(darks[colIndex]);
      g2.drawString(msg, 1, 9);
      g2.setColor(lites[colIndex]);
      g2.drawString(msg, 0, 8);

      if (ledOn) {
        g2.setColor(LED_ON);
      } else {
        g2.setColor(LED_OFF);
      }
      g2.fillRect(372, 3, 7, 1);
      g2.setColor(LED_BORDER);
      g2.drawRect(371, 2, 8, 2);
    }

    g.fillRect(0, 0, offsetX, displayHeight + offsetY * 2);
    g.fillRect(offsetX + displayWidth, 0,
        offsetX, displayHeight + offsetY * 2);
    g.fillRect(0, 0, displayWidth + offsetX * 2, offsetY);
    g.fillRect(0, displayHeight + offsetY,
        displayWidth + offsetX * 2, offsetY);
    Graphics2D g2d = (Graphics2D) g;
//  g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
//  RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g2d.drawImage(image, offsetX, offsetY, displayWidth, displayHeight, null);
//    g.drawImage(crtImage, offsetX, offsetY, displayWidth, displayHeight, null);

//     monitor.info("Repaint: " + (System.currentTimeMillis() - repaint) + " " + memory[IO_OFFSET + 55296 + 6 * 40]);
//     repaint = System.currentTimeMillis();
  }