public void paintImmediately(Rectangle r) { Component root = this.getRootPane(); if (root == null || ! root.isShowing()) return; Graphics g = root.getGraphics(); if (g == null) return;  Rectangle clip = SwingUtilities.convertRectangle(this, r, root); g.setClip(clip); root.paint(g); g.dispose();
public void paintImmediately(int x, int y, int w, int h) { paintImmediately(new Rectangle(x, y, w, h));
	public void paintImmediately(Rectangle r)	{    Component root = this.getRootPane();    if (root == null || ! root.isShowing())      return;    Graphics g = root.getGraphics();    if (g == null)      return;    Rectangle clip = SwingUtilities.convertRectangle(this, r, root);    g.setClip(clip);    root.paint(g);    g.dispose();	}