public void paint (Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0, getWidth(),getHeight()); for (int i=0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y,r.width,r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }
public void paint(Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); for (int i = 0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y, r.width, r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }
public void paint (Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0, getWidth(),getHeight()); for (int i=0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y,r.width,r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }