Ejemplo n.º 1
0
  public ImagePanel(Image image) {
    try {
      this.fileImage = ImageIO.read(image.getImage());
    } catch (Exception ex) {
      this.fileImage = null;
    }

    this.image = image;
    this.cacheImage = null;
  }
Ejemplo n.º 2
0
  public void setImage(Image image) {
    if (this.image != null && this.image.equals(image)) {
      clear();
      return;
    }

    try {
      this.fileImage = ImageIO.read(image.getImage());
    } catch (Exception ex) {
      this.fileImage = null;
    }

    this.image = image;
    clear();
    cacheImage = null;
  }