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

Exception occurred during event dispatching

XMLWordPrintable

    • 2d
    • x86
    • windows_nt

      I run the test case using jdk1.2.2_007 ang got same error,
      My coworker in east cost run using jdk1.2.2W (we are not sure what
      is the real number for this jdk) but does not got any errors.
      Hi,

      As per our phone conversation that our developers have encountered
      an exception thrown from their program when they migrate from
      JDK1.2.2_001-win
      to JDK1.2.2_006-win. According to the developers their program
      works fine with JDK1.2.2_001-win.

      The exception is thrown in the method called print(Graphics g, PageFormat
      pageFormat, int pageIndex)
      which the developers have implemented when implementing the
      java.awt.print.Printable interface.
      The exception is "Exception occurred during event dispatching:
      java.lang.IllegalArgumentException: Zero length string passed to TextLayout
      cons
      tructor.
              at java.awt.font.TextLayout.<init>(TextLayout.java:337)"

      I attached a sample Java program which can depict the exception problem
      that they are experiencing. The program consists these two files
      PrintTest.java and PrintUtilities.java.


       <<PrintTest>>
       <<PrintUtilities>>

      -------------------------------- other info
      CaseID # = 62305299
      JDK = 1.2.2_006-win
      Platform=NT4
      Error Msg =
      Exception occurred during event dispatching:
      java.lang.IllegalArgumentException: Zero length string passed to TextLayout
      cons
      tructor.
              at java.awt.font.TextLayout.<init>(TextLayout.java:337)
              at sun.java2d.PeekGraphics.drawString(PeekGraphics.java:845)
              at
      javax.swing.plaf.basic.BasicGraphicsUtils.drawString(BasicGraphicsUti
      ls.java:224)
              at
      javax.swing.plaf.basic.BasicLabelUI.paintEnabledText(BasicLabelUI.jav
      a:88)
              at javax.swing.plaf.basic.BasicLabelUI.paint(BasicLabelUI.java:168)
              at javax.swing.plaf.ComponentUI.update(ComponentUI.java:43)
              at javax.swing.JComponent.paintComponent(JComponent.java:329)
              at javax.swing.JComponent.paint(JComponent.java:638)
              at
      javax.swing.CellRendererPane.paintComponent(CellRendererPane.java:139
      )
              at
      javax.swing.CellRendererPane.paintComponent(CellRendererPane.java:162
      )
              at
      javax.swing.plaf.metal.MetalComboBoxButton.paintComponent(MetalComboB
      oxButton.java:163)
              at javax.swing.JComponent.paint(JComponent.java:638)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at javax.swing.JLayeredPane.paint(JLayeredPane.java:547)
              at javax.swing.JComponent.paintChildren(JComponent.java:452)
              at javax.swing.JComponent.paint(JComponent.java:641)
              at java.awt.Container.paint(Container.java:773)
              at PrintUtilities.print(PrintUtilities.java:64)
              at sun.java2d.RasterPrinterJob.printPage(RasterPrinterJob.java:485)
              at sun.java2d.RasterPrinterJob.print(RasterPrinterJob.java:235)
              at PrintUtilities.print(PrintUtilities.java:49)
              at PrintUtilities.printComponent(PrintUtilities.java:37)
              at PrintTest.actionPerformed(PrintTest.java:29)
              at
      javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:10
      66)
              at
      javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
      ctButton.java:1101)
              at
      javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
      .java:378)
              at
      javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250
      )
              at
      javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
      istener.java:204)
              at java.awt.Component.processMouseEvent(Component.java:3160)
              at java.awt.Component.processEvent(Component.java:2999)
              at java.awt.Container.processEvent(Container.java:990)
              at java.awt.Component.dispatchEventImpl(Component.java, Compiled
      Code)
              at java.awt.Container.dispatchEventImpl(Container.java, Compiled
      Code)
              at java.awt.Component.dispatchEvent(Component.java, Compiled Code)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java,
      Com
      piled Code)
              at
      java.awt.LightweightDispatcher.processMouseEvent(Container.java:1827)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1730)
              at java.awt.Container.dispatchEventImpl(Container.java, Compiled
      Code)
              at java.awt.Window.dispatchEventImpl(Window.java:749)
              at java.awt.Component.dispatchEvent(Component.java, Compiled Code)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java, Compiled Code)
              at
      java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java, C
      ompiled Code)
              at
      java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

      ---------------------------------------
      Please advice us as soon as possible.

      Thanks,

      Soo-On Lee
      (212)783-7798
      ###@###.###


      After you have compiled the java files.
      You can run the test from your command window as :
      java PrintTest

      GUI will appear. Then do these steps:
      1) enter any string on "User ID:" and "Password:" fields
      2) click "Print" button
      3) Print screen will appear
      4) click OK button

      You should see exception message on your command window.

            asultano Alex Sultanov
            pdziarma Piotr Dziarmaga (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: