JDK-4970030 : IllegalArgumentException when printing components with zero-length text
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-12-17
  • Updated: 2003-12-19
  • Resolved: 2003-12-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b32Fixed
Related Reports
Relates :  
Description
The fix to [4352983: Clipping of text when printing] is causing an IllegalArgumentException when printing components with zero-length text. The root cause is that the TextLayout constructor does not support zero-length Strings.

This causes a failure when trying to print a JTable that contains any empty table cells. It also causes the SwingSet2 JTable printing demo to fail. The cells containing ImageIcons have no text and trigger this problem.

Attached is a test case that demonstrates the problem. It simply attempts to print a JLabel containing the empty String.

Fixing this is VERY IMPORTANT for the new JTable printing support. 

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b32 tiger-beta
14-06-2004

EVALUATION we need to add zero-length checks to SwingUtilities2
11-06-2004

SUGGESTED FIX http://sa.sfbay.sun.com/projects/swing_data/tiger/4970030/
11-06-2004