JDK-6364555 : Some SwingSet2 components do not dynamically update font antialiasing.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-16
  • Updated: 2010-04-02
  • Resolved: 2006-02-02
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 6
6 b70Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
SwingSet2 has a couple of places where the text antialiasing does not dynamically
change when the desktop properties are changed. 
They start out with whatever is the initial desktop properties but it never changes.
The other components on the tab work fine.
I have seen this in all the L&Fs on Solaris and Windows, so it seems to be something
about those specific components. I thought perhaps they were custom components but
it doesn't appear to be so. The ones I have noticed are
 - In the JList Demo the left hand list of company names
    The cell renderer used here is a subclass of DefaultListCellRenderer
 - In the table demo the column headers.

Comments
EVALUATION Since this isn't that common, committing to dolphin. The fix is simply to forward the updateUI call to any renderers. See suggested fix.
19-12-2005

SUGGESTED FIX ------- JTree.java ------- *** //C/tmp/sccs.001000 Mon Dec 19 16:38:01 2005 --- JTree.java Mon Dec 19 16:21:10 2005 *************** *** 684,689 **** --- 684,695 ---- */ public void updateUI() { setUI((TreeUI)UIManager.getUI(this)); + + TreeCellRenderer renderer = getCellRenderer(); + if (renderer instanceof JComponent) { + ((JComponent)renderer).updateUI(); + } + invalidate(); } ------- JTableHeader.java ------- *** //C/tmp/sccs.001000 Mon Dec 19 16:38:26 2005 --- JTableHeader.java Mon Dec 19 16:27:08 2005 *************** *** 447,452 **** --- 447,458 ---- */ public void updateUI(){ setUI((TableHeaderUI)UIManager.getUI(this)); + + TableCellRenderer renderer = getDefaultRenderer(); + if (renderer instanceof JComponent) { + ((JComponent)renderer).updateUI(); + } + resizeAndRepaint(); invalidate();//PENDING } ------- JList.java ------- *** //C/tmp/sccs.001000 Mon Dec 19 16:38:57 2005 --- JList.java Mon Dec 19 16:03:16 2005 *************** *** 459,464 **** --- 459,470 ---- */ public void updateUI() { setUI((ListUI)UIManager.getUI(this)); + + ListCellRenderer renderer = getCellRenderer(); + if (renderer instanceof JComponent) { + ((JComponent)renderer).updateUI(); + } + invalidate(); }
19-12-2005

EVALUATION This seems to be related to having any cell renderer that is not the default one provided, as the test case below shows. Even replacing the renderer with an ordinary DefaultListCellRenderer causes the problem. Compile and run this test. On WindowsXP when I change the smoothing, only the first list is updated. The second one seems to cache whatever was being used before. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class ListAliasTest extends JFrame { public ListAliasTest() { super("ListAliasTest"); getContentPane().setLayout(new FlowLayout()); JList one = new JList(new String[] {"One", "Two", "Three"}); JList two = new JList(new String[] {"One", "Two", "Three"}); getContentPane().add(one); getContentPane().add(two); two.setCellRenderer(new DefaultListCellRenderer()); } private static void createAndShowGUI(String[] args) { ListAliasTest test = new ListAliasTest(); test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); test.pack(); test.setLocationRelativeTo(null); test.setVisible(true); } public static void main(final String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(args); } }); } }
16-12-2005