Knowee
Questions
Features
Study Tools

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?

🧐 Not the exact question you are looking for?Go ask a question

Solution

When we invoke repaint() for a java.awt.Component object, the AWT invokes the update() method.

Here are the steps that occur:

  1. The repaint() method is called on a Component object. This method is used to cause the component to be redrawn.

  2. The repaint() method actually calls the update() method of the Component. The update() method is responsible for repainting the component.

  3. The default implementation of update() in the Component class clears the component's drawing area and then immediately calls the paint() method.

  4. 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.

This problem has been solved

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

1/1

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.