Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4391493

Specifying DestinationType.FILE or DialogType.NONE in tk.getPrintJob ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • client-libs
    • 2d
    • sparc
    • solaris_8


      Given the following test code below, a printer dialog always appears.

      Happens on both Solaris and Windows.

      NOTE: DialogType.NONE
      NOTE: DestinationType.FILE

      There are two misbehaviors. First, even though DialogType.NONE is
      specified, a dialog does appear. Second, the dialog that appears
      doesn't have "Print To File" checked, and the file name to print to
      is not filled in with the file name specified in the code below.

      import java.awt.*;

      public class prtrial extends Frame {

        public prtrial() {
          super("prtrial");
          setSize(300,300);
          show();
          setVisible( true);
          doit();
        }

        public void doit() {
          Toolkit tk = Toolkit.getDefaultToolkit();
          JobAttributes ja = new JobAttributes();
          // getDialog == JobAttributes.DialogType.NONE
          PageAttributes pa = new PageAttributes();
          ja.setDestination(JobAttributes.DestinationType.FILE);
          ja.setFileName("jn-finalize");
          ja.setDialog(JobAttributes.DialogType.NONE);
          PrintJob pj = tk.getPrintJob( this, "finalize", ja, pa);
          pj.finalize();
        }


        public static void main(String[] args) {
          new prtrial();
        }

      }

            prr Philip Race
            dherronsunw David Herron (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: