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

How do you detect memory leaks?

588


what is the messsage u r going to get from an objectoriented programing?

1617


Does A Class Inherit The Constructors Of Its Superclass?

538


Explain the difference between serializable and externalizable in java?

543


Is java good for beginners?

583






What is difference between equal and == in java?

528


Can a static member function access member variable of an object?

564


Is it possible to compare various strings with the help of == operator? What are the risks involved?

624


Explain purpose of sleep() method in java?

624


What about main thread in java?

652


What is the difference between the ">>" and " >>>" operators in java?

513


How do you compare two strings lexicographically?

546


What happens if we override only equals?

587


What are different access specifiers in java?

573


Can a class be final?

502