Graphics g = jComponent.getGraphics();   ((Component)component).update(getGraphics());
final Graphics g = jComponent.getGraphics(); if (g != null) {   ((Component)component).update(getGraphics());  }
    public void handleEvent(AWTEvent event) {        switch (event.getID()) {            case PaintEvent.PAINT: {                Graphics g = jComponent.getGraphics();                //Point p = component.getLocationOnScreen();                //g.translate(p.x, p.y);                ((Component)component).paint(g);                //g.translate(-p.x, -p.y);            } break;            case PaintEvent.UPDATE: {                Graphics g = jComponent.getGraphics();                //Point p = component.getLocationOnScreen();                //g.translate(p.x, p.y);                ((Component)component).update(getGraphics());                //g.translate(-p.x, -p.y);            } break;        }    }