// #ifdef VER_4.5.0
  public void paint(Graphics g) {

    int oldColor = g.getColor();
    g.setColor(0x00000000);
    g.drawRect(0, 0, getWidth() + 1, getHeight() + 1);
    g.setColor(oldColor);
    super.paint(g);
  }
示例#2
0
  protected void paint(Graphics g) {
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, userField.getWidth() + 8, userImage.getHeight());

    g.setColor(Color.GRAY);
    g.drawRect(0, 0, userField.getWidth() + 8, userImage.getHeight());

    super.paint(g);
  }
  private void drawBitmap(Graphics gfx) {
    final int width = imageBmp.getWidth();
    final int height = imageBmp.getHeight();

    final int x = paddingLeft + ((desiredImgWidth - width) >> 1);
    final int y = paddingTop + ((desiredImgHeight - height) >> 1);

    gfx.drawBitmap(x, y, width, height, imageBmp, 0, 0);

    final int initialColor = gfx.getColor();
    gfx.setColor(Color.GRAY);
    gfx.drawRect(x, y, width, height);
    gfx.setColor(initialColor);
  }