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.
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.