Java Swing Tutorial - Java Toolkit.getColorModel()








Syntax

Toolkit.getColorModel() has the following syntax.

public abstract ColorModel getColorModel()     throws HeadlessException

Example

In the following code shows how to use Toolkit.getColorModel() method.

/*from  w w w.  j av  a2s.  c o  m*/
import java.awt.Toolkit;

public class Main {
  public static void main(String[] args) {
    Toolkit tk = Toolkit.getDefaultToolkit();
    System.out.println("Color model = " + tk.getColorModel());

  }
}

The code above generates the following result.