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

UIMM: Desktop print failed when printing bmp image

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5.1, windows_xp

      Description

      FULL JDK VERSION(S):
      -------------------
      java version "1.6.0_02"
      Java(TM) SE Runtime Environment (build 1.6.0_02-b04)
      Java HotSpot(TM) Client VM (build 1.6.0_02-b04, mixed mode)

      DESCRIPTION:
      ------------
      PROBLEM DESCRIPTION

      Printing a bmp image failed when print() method of Desktop API introduced in Java6 is used.
       
      Calling the print() method opens the photo printing wizard, but clicking on next does not show the bmp image selected for printing.

      Right clicking on the .bmp file and selecting windows print option, launches the photo printing wizard and displays a preview of the bmp image that has to be printed.

      TESTCASE DESCRIPTION

      This test case tests whether print() method of Desktop API introduced in Java6 prints a bmp image. The test gets the Desktop and calls the print method by passing a .bmp file. The program calls a sleep of 20 seconds for the user to print the bmp file through the photo printing
      wizard.

       
      STEPS TO REPRODUCE

      1) Execute the below command:
      >>java DesktopPrint

      2) Click on next in the photo print wizard, the bmp image that has to be printed is not shown.

      TEST CASE:

      import java.awt.Desktop;
      import java.io.*;

      class DesktopPrint
      {

          DesktopPrint()
          {
          }

          public static void main(String args[])
          {
              Desktop desktop = null;
              if(Desktop.isDesktopSupported())
                  desktop = Desktop.getDesktop();
              else
                  System.out.println("Desktop is not supported on this platform");
              try
              {
                  desktop.print(new File("sample.bmp"));
                  //Thread.sleep(20000L);
              }
              catch(IOException ioexception)
              {
                  System.out.println("Desktop print failed with IOException");
                  ioexception.printStackTrace();
              }
              catch(Exception interruptedexception)
              {
                  System.out.println("Desktop print failed with InterruptedException");
                  interruptedexception.printStackTrace();
              }
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                denis Denis Fokin (Inactive)
                Reporter:
                elarsen Erik Larsen (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: