Print function for FORM in Java
Public void print (jframe frame) {Container Container = frame.getContentPane (); Properties Prop = New Properties ();
PrintJob Job = getToolkit (). GetPrintJob (Frame, "Test", Prop); // printJob Job = GetToolkit (). GetPrintJob (this, "test", prop); if (job! = Null) {graphics pg = Job .getgraphics (); if (pg! = null) {pg.Translate (). width-getSize (). width/2/2 (Job.getPageDimension (). Height-getSize (). HEIGHT) / 2); // Old Code - Container.print (pg); Print (pg); pg.dispose ();
Job.end ();}} Job = NULL;