I should add, I haven't tried this. I just knocked this code up as an example of how you could implement a UI Component model. You'd need to do quite a bit of work to build a complete implementation. (This is how LWUIT works.) For example, you'd need to implement a system whereby changes to the state of the component cause the container to repaint. Ideally, you'd want to change Container.paint(), so that it can handle a partial repaint, and only repaint Components in the affected area (rather than trying to repaint every component every time).
In that code, I move the origin and set the clip region, so that in the component's paint method, the (0, 0) is in the top left corner of the component (no matter where it is on the screen). Remember that every component is being painted on the same Graphics object. Since this will be called for each component (in a loop), it's important to put everything back afterwards, so that the next component can be painted in the same way. Really, it should reset the colour, font, and so on, as well. Any change one component makes to the Graphics object should not affect later components.