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