Пример #1
0
  protected void paintComponent(Graphics g) {

    if (this.paintProvider != null) {

      Paint p = this.paintProvider.getPaint(this);

      Graphics2D g2d = (Graphics2D) g;

      int w = this.getWidth();
      int h = this.getHeight();

      g2d.setPaint(p);
      g2d.fillRect(0, 0, w, h);

      this.setOpaque(false);
    }

    super.paintComponent(g);

    // this.setOpaque (true);

  }
 @Override
 public void paintComponent(Graphics g) {
   g.drawImage(back, 0, 0, null);
   super.paintComponent(g);
 }