How to disable/enable the selection in printer dialog?

Discussion in 'Java' started by JessyCute, Apr 3, 2006.

  1. JessyCute

    JessyCute Guest

    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.
    JessyCute, Apr 3, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel Lee
    Replies:
    0
    Views:
    515
    Samuel Lee
    Nov 11, 2003
  2. Patrick
    Replies:
    1
    Views:
    649
  3. Awais Bajwa
    Replies:
    0
    Views:
    322
    Awais Bajwa
    Sep 10, 2003
  4. Jo Claes

    Installed Printers - Printer Selection

    Jo Claes, Jul 15, 2003, in forum: Javascript
    Replies:
    1
    Views:
    84
    Grant Wagner
    Jul 15, 2003
  5. Replies:
    5
    Views:
    145
Loading...

Share This Page