-
Bug
-
Resolution: Fixed
-
P3
-
1.4.2, 5.0, 6
-
b105
-
x86
-
linux, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2172580 | 6-pool | Sergey Malenkov | P3 | Closed | Won't Fix | |
JDK-2172579 | 5.0-pool | Miroslaw Niemiec | P3 | Closed | Won't Fix | |
JDK-2172578 | 1.4-pool | Unassigned | P5 | Closed | Not an Issue |
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Server VM (build 1.5.0-b64, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
SunOS raptor 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Fire-480R
A DESCRIPTION OF THE PROBLEM :
When using a JColorChooser, performing a UIManager.setLookAndFeel() removes the preview of the color from the bottom of the JColorChooser. Works fine in java 1.4, but is broken in java5, on both solaris and windows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a new Swing JFrame, with a JButton and a JColorChooser, and on button click, have the UIManager set the look and feel to something else.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Look and feel changes, with all components being updated (including the preview of the JColorChooser)
ACTUAL -
Look and feel changes, but removes the preview completely from the JColorChooser, and does not replace it when going back to the original look and feel.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Broken
{
static int currentLookAndFeel = 0;
public static void createAndShowGui()
{
final JFrame frame = new JFrame("Broken.");
JPanel panel = new JPanel();
JColorChooser colors = new JColorChooser();
JButton button = new JButton("change LandF");
button.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
currentLookAndFeel++;
String sebLookAndFeel = UIManager.getInstalledLookAndFeels()[currentLookAndFeel % UIManager.getInstalledLookAndFeels().length].getClassName();
try
{
UIManager.setLookAndFeel(sebLookAndFeel);
}
catch (Exception ex) {}
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();
}
});
panel.add(colors);
panel.add(button);
frame.getContentPane().add(panel);
frame.pack();
frame.setVisible(true);
}
public static void main (String[] args)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
createAndShowGui();
}
});
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
- backported by
-
JDK-2172579 REGRESSION: ColorChooser loses preview when change LandF in Java5
- Closed
-
JDK-2172580 REGRESSION: ColorChooser loses preview when change LandF in Java5
- Closed
-
JDK-2172578 REGRESSION: ColorChooser loses preview when change LandF in Java5
- Closed
- duplicates
-
JDK-5029286 REGRESSION: JColorChooser.setPreviewPanel() does not show custom preview panel
- Closed
- relates to
-
JDK-4759306 1.4.1 REGRESSION: JColorChooser.setPreviewPanel does not remove the old one
- Resolved
-
JDK-4783584 Tiger: 1.4.1 REGRESSION: JColorChooser.setPreviewPanel does not remove the old o
- Resolved
-
JDK-6977726 JColorChooser.getPreviewPanel() returnes null starting from jdk7 b105.
- Closed
-
JDK-6978490 Two java/swing test failed just against jdk7 b105 and passed against b104
- Closed