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

IllegalArgumentException when printing components with zero-length text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 5.0
    • 5.0
    • client-libs
    • None
    • b32
    • generic
    • generic

      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.

            idk Igor Kushnirskiy (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: