well you create a component, set its size, and overwrite its paintComponent method to draw the ovals. Their x/y coordinate is based on the 0,0 x/y coordinate of the component. Move the component and, of course, whatever you paint on it goes with it. If all you are doing is adding AWT/Swing components, then you don't have to overwrite the paint method..just add it to a container like normal. Overwriting the paint method is used only for custom components. I hope this makes sense.
|