Showing posts with label All about Graphics. Show all posts
Showing posts with label All about Graphics. Show all posts

Monday, 15 February 2016

Functions available in Graphics Class in Java

All about Graphics Class in Java

Sub classes in the Graphics Class

  • DebugGraphics
  • Graphics2D



                The Graphics class is an abstract Class that contains all the components to allow an application to draw on various devices. The Object of the Graphics Class encapsulates the information needed for the basic operation that Java supports. The information includes the following properties. 

  1. The Component Object
  2. A transition origin for rendering and clipping coordinates
  3. Current Clip
  4. Current Color
  5. Current Font
  6. Current logical pixel operation function
  7. Current XOR alternation color

The coordinates are thin and size depends upon the pixel size of the output device.  The important functions/methods inside the Graphics Class is listed below:

  • drawLine()
  • setColor()
  • getColor()