nswerWhen we invoke repaint() for a java.awt.Component object, the AWT invokes which of thefollowing method ?
Question
Answer
When we invoke repaint()
for a java.awt.Component
object, the AWT invokes which of the following method?
Solution
When we invoke repaint() for a java.awt.Component object, the AWT invokes the update() method.
Here are the steps that occur:
-
The repaint() method is called on a Component object. This method is used to cause the component to be redrawn.
-
The repaint() method actually calls the update() method of the Component. The update() method is responsible for repainting the component.
-
The default implementation of update() in the Component class clears the component's drawing area and then immediately calls the paint() method.
-
The paint() method is where the component's appearance is actually drawn. This method is usually overridden in a subclass to provide the specific appearance for the component.
So, in summary, when repaint() is called, it leads to the invocation of the update() method, which in turn calls the paint() method.
Similar Questions
Which is a Java call-back method invoked when a view is clicked of the following?a.Detectorb.None of thesec.OnClickDetectord.OnTapListener
Which method is used to set the visibility of a component in Java GUI?1 pointsetVisible()add()remove()setEnabled()
Which of the following is used to interpret and execute Java Applet Classes hosted by HTML. appletshow appletviewerappletwatcherappletscreen
Which of this package is used for invoking a method remotely?Optionsjava.awtjava.rmijava.utiljava.applet
the correct answerWhich of this package is used for invoking a method remotely?Optionsjava.rmijava.utiljava.awtjava.applet
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.