JDK-6511744 : JRadioButton in JTree is not painted in correct state on Vista
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: generic
  • Submitted: 2007-01-10
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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 JDK 7
6u1Fixed 7 b10Fixed
Related Reports
Relates :  
Description
from ###@###.###:
I am trying to figure out the cause of some strange behavior of JRadioButtons embedded in JTree on Vista.  This is happening in Advanced tab of Java Control Panel.  There is a JTree containing nodes of JRadioButton(s).  Multiple radio buttons are painted selected on windows Vista.  You can see this on example of Java console node.  The buttons get selected pretty much randomly.  The radio button I click on usually is the one NOT selected, while the other two or more (or none at all) would get selected.

I noticed that this behavior is happening with Vista colors and appearance.  If I change the windows appearance to Classic this is not happening.  With JRE 1.5.0_09 this is not happening either even with Vista Aero appearance.
I suspect that this behavior has something to do with vista L&F implementation.  Could you please take a look at this?  This is rather urgent since it makes the Java Control Panel totally useless on Vista.

Comments
EVALUATION Unfortunately I do not see how we can support animation for JTable, JTree and JList. I suggest to disable it for these components. ---- --- XPStyle.java Wed Jan 10 17:13:32 2007 *************** *** 571,581 **** * the image to be stretched or tiled * @param state which state to paint */ void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) { if (ThemeReader.isGetThemeTransitionDurationDefined() ! && component instanceof JComponent ) { AnimationController.paintSkin((JComponent) component, this, g, dx, dy, dw, dh, state); } else { paintSkinRaw(g, dx, dy, dw, dh, state); } --- 571,583 ---- * the image to be stretched or tiled * @param state which state to paint */ void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) { if (ThemeReader.isGetThemeTransitionDurationDefined() ! && component instanceof JComponent ! && SwingUtilities.getAncestorOfClass(CellRendererPane.class, ! component) == null) { AnimationController.paintSkin((JComponent) component, this, g, dx, dy, dw, dh, state); } else { paintSkinRaw(g, dx, dy, dw, dh, state); } ---- Do not do animation for any component which belongs to CellRendererPane. That solves it for JTree, JTable and JList
10-01-2007

WORK AROUND One can disable animation on vista running java with java -Dswing.disablevistaanimation=true that should fix this problem
10-01-2007

EVALUATION This is a regression introduced by the fix for 6435825 [Win Vista: add animation support for swing components.] That fix sends a number of repaint events to a component to animate it from the old state to the new one. It works under the assumption that there is a one to one mapping between an instance of component and rendered widget on the screen. This assumption is wrong for JTree, JList and JTable for they might have the same component used to render multiple widgets on the screen.
10-01-2007