Which of the following are passed as an argument to the paint( ) method?

A) A Canvas object
B) A Graphics object
C) An Image object
D) A paint object

Showing Answers 1 - 6 of 6 Answers

The Graphic object is passed as argument to paint() method.

This method is invoked by Swing to draw componet.

public abstract class Graphics
extends Object

The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.

A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. This state information includes the following properties:

  • The Component object on which to draw.
  • A translation origin for rendering and clipping coordinates.
  • The current clip.
  • The current color.
  • The current font.
  • The current logical pixel operation function (XOR or Paint).
  • The current XOR alternation color (see setXORMode(java.awt.Color)).

  Was this answer useful?  Yes

Ahmad javed

  • May 3rd, 2016
 

D) A paint object

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions