Difference between canvas class & graphics class?

Answer Posted / mallareddy.pindi

The Canvas class is a base class for writing applications
that need to handle low-level events and to issue graphics
calls for drawing to the display. Game applications will
likely make heavy use of the Canvas class. From an
application development perspective, the Canvas class is
interchangeable with standard Screen classes, so an
application may mix and match Canvas with high-level screens
as needed. For example, a List screen may be used to select
the track for a racing game, and a Canvas subclass would
implement the actual game.
The Graphics class provides the framework for all graphics
operations within the AWT. It plays two different, but
related, roles. First, it is the graphics context. The
graphics context is information that will affect drawing
operations. This includes the background and foreground
colors, the font, and the location and dimensions of the
clipping rectangle

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are predefined functions?

559


What is Major and importance difference between for and foreach loop ?

568


Is boolean a data type in java?

510


Can you explain the final method modifier?

557


What is int short for?

505






Explain static nested classes ?

584


Which access specifier can be used with class ?

524


What is the use of a copy constructor?

564


Explain the use of volatile field modifier?

625


Differentiate between static and non-static methods in java.

555


What is command line used for?

579


What is the file extension for java?

596


What are keywords and reserved words in java?

549


What does localhost mean?

485


What is json parser in java?

605