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

print() method of DocPrintJob throws ClassCastException for Media attributes

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      beta2
    • CPU:
      sparc
    • OS:
      solaris
    • Verification:
      Verified

      Description


      print() method of DocPrintJob throws ClassCastException for some of the Media
      attributes that are added to the HashPrintRequestAttributeSet.
      Attached is a sample program and a gif file that the testcase tries to print using the Media attributes.
      A media attribute(MediaName or MediaTray or MediaSizeName) is added to the HashPrintRequestAttribute and passed on to DocPrintJob for printing

      The testcase when run throws the following exception:
      java.lang.ClassCastException: javax.print.attribute.standard.MediaName
               at sun.print.UnixPrintJob.getAttributeValues(UnixPrintJob.java:670)
               at sun.print.UnixPrintJob.print(UnixPrintJob.java:301)
               at MediaTest.printImage(MediaTest.java:166)
               at MediaTest.<init>(MediaTest.java:34)
               at MediaTest.main(MediaTest.java:176)
       
      Source: MediaTest.java
      Resource: TopLogo.gif

        Attachments

          Activity

            People

            Assignee:
            jgodinez Jennifer Godinez (Inactive)
            Reporter:
            kbalasubsunw Kannan Balasubramanian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: