Java Swing Tutorial - Java GraphicsConfiguration .getDefaultTransform ()








Syntax

GraphicsConfiguration.getDefaultTransform() has the following syntax.

public abstract AffineTransform getDefaultTransform()

Example

In the following code shows how to use GraphicsConfiguration.getDefaultTransform() method.

import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
/* ww w .  j  ava 2 s .  co  m*/
public class Main {
    public static void main(String[] argv) {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gs = ge.getDefaultScreenDevice();
        GraphicsConfiguration gc = gs.getDefaultConfiguration();
        System.out.println(gc.getDefaultTransform());
    }
}

The code above generates the following result.