What is paint method? What should we put in paint method?

What is paint method? What should we put in paint method? When is it invoked?

- The AWT uses a Callback mechanism for painting which is the same for heavyweight and lightweight components.

- The components rendering code should be inside a program's overridden method so that the AWT can invoke it while painting.

- When AWT invokes this method, the Graphics object parameter is pre-configured with the appropriate state for drawing.
What is the purpose of repaint method? When should we use repaint method?
Purpose of repaint method - repaint() requests an erase and redraw (update) after a small time delay...
Use of update method. When is it invoked?
Use of update method - An update method is called on calling the repaint method...
How does the XOR drawing mode work? What are the properties of XOR drawing?
XOR drawing mode - setXORMode(Color c1) sets the paint mode of this graphics context to alternate between a graphics context's current color and the new specified color...
Post your comment