This program shows a stack over flow ..
import java.awt.print.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
public class PD {
public static void main(String args[]) {
PrinterJob job = PrinterJob.getPrinterJob();
if (job == null) {
return;
}
PrintRequestAttributeSet pSet =
new HashPrintRequestAttributeSet();
pSet.add(DialogTypeSelection.NATIVE);
job.printDialog(pSet);
job.pageDialog(pSet);
}
}
Exception in thread "main" java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at sun.print.RasterPrinterJob.pageDialog(RasterPrinterJob.java:720)
at sun.print.RasterPrinterJob.pageDialog(RasterPrinterJob.java:762)
at sun.print.RasterPrinterJob.pageDialog(RasterPrinterJob.java:737)
at sun.print.RasterPrinterJob.pageDialog(RasterPrinterJob.java:762)
at sun.print.RasterPrinterJob.pageDialog(RasterPrinterJob.java:737)