JDK-6788641 : Clipped text in Swing components since jdk7 b38
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2008-12-23
  • Updated: 2011-01-19
  • Resolved: 2009-06-26
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.
JDK 7
7Resolved
Related Reports
Duplicate :  
Description
The jdk7 b38 fix for
6584657 : GTK Look and Feel: Bugs in menu item layout

made changes in SwingUtilities calculation of the width of text.
This has lead to text in some UI components being clipped (and "..."  displayed)
where there ought to be enough space.

In the example below using the standard print dialog, the word "Print" on
the JButton is clipped, and on the second tab "Portrait" is clipped.

import java.awt.print.*;
import javax.print.attribute.*;

public class PrtDlg {

   public static void main(String[] args) {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.printDialog(new HashPrintRequestAttributeSet());
   }
}
In addition, I see something closely related when printing. I used the CardTest
demo applet on both Solaris SPARC and on Linux and see button label clipping when
selecting appletviewer's "Print" menu option. This started in JDK 7 b07
and is probably somehow caused by the fix for
6464003 : Text truncated in JLabel

To reproduce run CardTest, press "Two" to relay out and then print.
I've attached "ps" output from b06 and b07 so you can see the problem.

NB prior to b07 AWT included MToolkit but I don't think this is related to that removal, since XAWT with b06 does not exhibit the problem.