} catch (Exception ex) {
throw new PrinterException(ex.getMessage());
}
return PAGE_EXISTS;
}

 private static double dbldgt(double d) {
return Math.round(d * 10.) / 10.; // show one digit after point
}

 public static void main(String[] args) {
PrinterJob pj = PrinterJob.getPrinterJob();
pj.setPrintable(new MyPrintableObject());
 if (pj.printDialog()) {
 try {
pj.print();
 } catch (PrinterException e) {
System.out.println(e);
}
}
}
}


上一页 [1] [2] |