List of usage examples for java.awt GraphicsEnvironment createGraphics
public abstract Graphics2D createGraphics(BufferedImage img);
From source file:Main.java
public static void main(String[] args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); BufferedImage bi = new BufferedImage(10, 20, 0); Graphics2D g2 = ge.createGraphics(bi); }