Java Swing Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.00

Graphics Environment of the Local System

This chapter provides tutorial notes and example codes on local graphics environment. Topics include java.awt.GraphicsEnvironment class description and example; java.awt.Toolkit class description and example; calculating screen resolution with the default Toolkit object.

java.awt.GraphicsEnvironment - Graphics Environment Class

java.awt.Toolkit - AWT Base Class

Testing Screen Resolution

Conclusion:

  • java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment() returns the local graphics environment object.
  • java.awt.Toolkit.getDefaultToolkit() returns the default Toolkit object.

Dr. Herong Yang, updated in 2009
Graphics Environment of the Local System