-
Bug
-
Resolution: Fixed
-
P3
-
7u4, 8
-
b20
-
x86
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8046628 | 9 | Sergey Bylokhov | P3 | Resolved | Fixed | b22 |
JDK-8048431 | 8u25 | Sergey Bylokhov | P3 | Resolved | Fixed | b05 |
JDK-8053688 | emb-8u26 | Sergey Bylokhov | P3 | Resolved | Fixed | b17 |
JDK-8181004 | openjdk7u | Sergey Bylokhov | P3 | Resolved | Fixed | master |
FULL PRODUCT VERSION :
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b121)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b63, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
when opening JDialogs or JMenus with Nimbus Look & Feel and the L&F color changed so a dark background is used, JDialogs and JMenus are first painted white and then painted in their designated color, leading to an ugly "flashing" effect.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the test code given below and click on the button.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog and JMenu should immediately be painted in their designated color.
ACTUAL -
see description (white flashing)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.plaf.ColorUIResource;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TestDarkNimbus {
public static void main(String[] args) throws Exception {
for(LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()){
if(info.getName().startsWith("Nimbus")){
System.out.println("Setting Look & Feel to " + info.getName());
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
UIDefaults d = UIManager.getDefaults();
d.put("control", new ColorUIResource(54, 54, 54));
d.put("text", new ColorUIResource(214, 214, 214));
d.put("nimbusBlueGrey", new ColorUIResource(44, 44, 44));
d.put("nimbusBase", new ColorUIResource(54, 54, 54));
d.put("nimbusFocus", new Color(71, 85, 101));
d.put("nimbusLightBackground", new ColorUIResource(54, 54, 54));
d.put("nimbusSelectionBackground", new ColorUIResource(51, 65, 81));
d.put("nimbusSelection", new ColorUIResource(51, 65, 81));
final JFrame frame = new JFrame(TestDarkNimbus.class.getSimpleName());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test Dialog Flashing");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(frame.getContentPane(), "Flash !!!!!!!!!!!!", "Flash demo",
JOptionPane.INFORMATION_MESSAGE);
}
});
frame.getContentPane().add(button);
frame.pack();
frame.setLocation(500, 500);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
none found so far
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b121)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b63, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
when opening JDialogs or JMenus with Nimbus Look & Feel and the L&F color changed so a dark background is used, JDialogs and JMenus are first painted white and then painted in their designated color, leading to an ugly "flashing" effect.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the test code given below and click on the button.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog and JMenu should immediately be painted in their designated color.
ACTUAL -
see description (white flashing)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.plaf.ColorUIResource;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TestDarkNimbus {
public static void main(String[] args) throws Exception {
for(LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()){
if(info.getName().startsWith("Nimbus")){
System.out.println("Setting Look & Feel to " + info.getName());
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
UIDefaults d = UIManager.getDefaults();
d.put("control", new ColorUIResource(54, 54, 54));
d.put("text", new ColorUIResource(214, 214, 214));
d.put("nimbusBlueGrey", new ColorUIResource(44, 44, 44));
d.put("nimbusBase", new ColorUIResource(54, 54, 54));
d.put("nimbusFocus", new Color(71, 85, 101));
d.put("nimbusLightBackground", new ColorUIResource(54, 54, 54));
d.put("nimbusSelectionBackground", new ColorUIResource(51, 65, 81));
d.put("nimbusSelection", new ColorUIResource(51, 65, 81));
final JFrame frame = new JFrame(TestDarkNimbus.class.getSimpleName());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button = new JButton("Test Dialog Flashing");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(frame.getContentPane(), "Flash !!!!!!!!!!!!", "Flash demo",
JOptionPane.INFORMATION_MESSAGE);
}
});
frame.getContentPane().add(button);
frame.pack();
frame.setLocation(500, 500);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
none found so far
- backported by
-
JDK-8046628 White flashing when opening Dialogs and Menus using Nimbus with dark background
- Resolved
-
JDK-8048431 White flashing when opening Dialogs and Menus using Nimbus with dark background
- Resolved
-
JDK-8053688 White flashing when opening Dialogs and Menus using Nimbus with dark background
- Resolved
-
JDK-8181004 White flashing when opening Dialogs and Menus using Nimbus with dark background
- Resolved