ADDITIONAL SYSTEM INFORMATION :
(Tested with multiple versions of Java from 8 through 14).
scrappy:Documents jimdouglas$ jdk-14.jdk/Contents/Home/bin/java -version
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+1-1)
OpenJDK 64-Bit Server VM (build 14-ea+1-1, mixed mode, sharing)
scrappy:Documents jimdouglas$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.5
BuildVersion: 18F132
scrappy:Documents jimdouglas$
A DESCRIPTION OF THE PROBLEM :
When opening a JComboBox component, it briefly shows the contents of the previously opened JComboBox.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The best way to see this is to capture a video of the interaction (CMD+SHIFT+5), spend 10-15 seconds cycling through the JComboBox components, then step through the video frame by frame using the right and left arrow keys.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When opening a JComboBox, I'd expect to see the contents of that specific list, with no rendering artifacts.
ACTUAL -
This effect is extremely subtle, but reasonably consistent; most of the time, opening the JComboBox very briefly flashes the contents of the previously opened list before switching over to the correct list.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ComboBox extends JPanel
{
public ComboBox()
{
String[] x1 = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
String[] x2 = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
String[] x3 = { "k", "l", "m", "n", "o", "p", "q", "r", "s", "t" };
JComboBox cb1 = new JComboBox(x1);
JComboBox cb2 = new JComboBox(x2);
JComboBox cb3 = new JComboBox(x3);
add(cb1);
add(cb2);
add(cb3);
setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
}
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
System.out.println(UIManager.getLookAndFeel());
JFrame frame = new JFrame("ComboBox");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JComponent newContentPane = new ComboBox();
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
frame.pack();
frame.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None.
FREQUENCY : always