List of usage examples for java.awt PrintJob getPageResolution
public abstract int getPageResolution();
From source file:PrintTestApp.java
public PrintTestApp() { super("PrintTestApp"); toolkit = getToolkit();// www . j a v a 2 s . com add("Center", textArea); setSize(300, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); String name = "Test print job"; Properties properties = new Properties(); PrintJob pj = toolkit.getPrintJob(PrintTestApp.this, name, properties); if (pj == null) textArea.setText("A null PrintJob was returned."); else { String output = "Name: " + name + "\nProperties: " + properties.toString(); Dimension pageDim = pj.getPageDimension(); int resolution = pj.getPageResolution(); boolean lastPageFirst = pj.lastPageFirst(); output += "\nPage dimension (in pixels):"; output += "\n height: " + String.valueOf(pageDim.height); output += "\n width: " + String.valueOf(pageDim.width); output += "\nResolution (pixels/inch): " + String.valueOf(resolution); output += "\nLast Page First: " + String.valueOf(lastPageFirst); textArea.setText(output); Graphics g = pj.getGraphics(); g.dispose(); pj.end(); } }