Whats all this about subclassing Canvas and overriding paint() ? Can I just do a getGraphics() for a component, and draw directly on that?
• A. You can do that, and it might work up to a point (or it might not). A problem arises when the window system wants to refresh that component e.g. because it has been partially obscured and is now revealed. It calls paint(), and paint() has no knowledge of the other g.drawing() you have just done.
Related Questions
- When there is a reduction in effort for an individual with both cost shared and directly charged salary, to which component does the reduction apply?
- Whats all this about subclassing Canvas and overriding paint() ? Can I just do a getGraphics() for a component, and draw directly on that?
- How to draw Component Diagram?