How to disable/enable the selection in printer dialog?

J

JessyCute

I would like to disable or enable the user' selection in the printer
dialog.
Code:


import java.awt.Graphics;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterJob;

public class TestPrintDialog implements Printable {

public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
return(NO_SUCH_PAGE);
}

public void testPrint(){
try{
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
printJob.printDialog(); //show print dialog.
}catch(Exception err){
err.printStackTrace();
}
}

public static void main(String[] args) {
new TestPrintDialog().testPrint();
}
}




Follow by this code. It will show the printer dialog that disable the
selection choice of print range. That I would like to do, enable the
seleciton choice in print range or disable some selection in this
dialog.

Anyone how can do? Thank in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top