switch (event.getID()) { case PaintEvent.PAINT: { final Graphics g = jComponent.getGraphics(); if (g != null) {   ((Component)component).paint(g);  } } break;
final int id = event.getID(); switch (id) { case PaintEvent.PAINT:
    public void handleEvent(AWTEvent event) {        switch (event.getID()) {            case PaintEvent.PAINT: {                final Graphics g = jComponent.getGraphics();                if (g != null) {                	//Point p = component.getLocationOnScreen();                	//g.translate(p.x, p.y);                	((Component)component).paint(g);                	//g.translate(-p.x, -p.y);                }            } break;            case PaintEvent.UPDATE: {                final Graphics g = jComponent.getGraphics();                if (g != null) {                	//Point p = component.getLocationOnScreen();                	//g.translate(p.x, p.y);                	((Component)component).update(g);                	//g.translate(-p.x, -p.y);                }            } break;            case MouseEvent.MOUSE_MOVED:            case MouseEvent.MOUSE_DRAGGED:            case MouseEvent.MOUSE_WHEEL:            case MouseEvent.MOUSE_PRESSED:            case MouseEvent.MOUSE_RELEASED:            case MouseEvent.MOUSE_CLICKED: {                    MouseEvent me = new MouseEvent(                            jComponent,                            event.getID(),                            ((MouseEvent)event).getWhen(),                            ((MouseEvent)event).getModifiers(),                            ((MouseEvent)event).getX(),                            ((MouseEvent)event).getY(),                            ((MouseEvent)event).getClickCount(),                            ((MouseEvent)event).isPopupTrigger(),                            ((MouseEvent)event).getButton()                    );                    jComponent.dispatchEvent(me);                } break;        }    }