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.

Comments

EVALUATION
Note: I did not see an "OK button." I assume the "Print" button on the
print dialog was meant, rather than the OK button on the "print screen."
I can reproduce this with 1.2.2-W (the final version that was released)
on Solaris sparc 2.7 and NT4, but not with 1.3 or 1.4 on the same systems.
Since it is not reproducible in the latest public release, or the current
release, I will close this report as not reproducible.
If a patch for 1.2.2 is needed, it will have to be handled as a technical
escalation through CTE.
eric.hawkes@eng 2001-01-17
alex.sultanov@Ireland 2001-01-24
Please note that this is a duplicate of #4223328.
I am reopening this bug for tracking purposes only because there is an open
escalation #529016 for 1.2.2.
=================
4223328 is assigned to classes_2D. If this is really a duplicate of that
bug, this bug should be assigned to the same subcategory.
eric.hawkes@eng 2001-02-07
Since this is a dup of 4223328, I'm closing it as a dup. I'll add on
the commit to fix in 1.2.2_008 in that bug report. It gets confusing if
dups are kept open.
jeannette.hung@Eng 2001-02-12