Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.print.*;
- public class PrintTest
- {
- public static void main(String [] args)
- {
- Patient myPatient = new Patient("Saeid", "Wazzan", 21);
- PrinterJob job = PrinterJob.getPrinterJob();
- job.setPrintable(myPatient);
- boolean doPrint = job.printDialog();
- if (doPrint)
- {
- try {
- job.print();
- } catch (PrinterException e) {
- System.out.println("Failed to print");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment