import java.awt.print.*; import java.awt.*; public class Trykk3{ public static void main(String argumendid[]) throws PrinterException{ PrinterJob pj=PrinterJob.getPrinterJob(); PageFormat pf=pj.defaultPage(); Paper p=pf.getPaper(); p.setImageableArea(0, 0, p.getWidth(), p.getHeight()); pf.setPaper(p); pj.setPrintable(new Trykitoo3(), pf); pj.print(); } } class Trykitoo3 implements Printable{ public int print(Graphics g, PageFormat pf, int lk)throws PrinterException{ if(lk>0) return Printable.NO_SUCH_PAGE; g.drawOval(0, 0, 300, 200); return Printable.PAGE_EXISTS; } }