Difference between the paint() and repaint() methods

What is the difference between the paint() and repaint() methods?

paint()repaint()
The paint() method is called when some action is performed on the window.Whenever a repaint method is called, the update method is also called along with paint() method.
This method supports painting via graphics object.This method is used to cause paint() to be invoked by the AWT painting thread.

What is the purpose of the enableEvents() method?
Purpose of the enableEvents() method - When you register a listener, enableEvents() is called. So you don’t have to do this separately...
Difference between a Scrollbar and a ScrollPane
Scrollbar and a ScrollPane - A Scrollbar is a Component. Scrollpane is a Container...
Difference in using runnable and extends in Thread.
JAVA Runnable and Extents - We can use Extend Thread class only when the class is not extending another class...
Post your comment