I have a JOptionPane with a custom message bar in an application designed for Java 1.5. The panel contains, among other things, JTextField. Every 20 prompts or so, nothing in the dialog box is colored (even the OK / Cancel buttons). If I dragged the dialog box from the screen and again to force it to redraw, the components will be visible as expected, and, apart from the painting problem, the components will respond normally. Here is the smallest example I could show in this error:
public class BugTest { public static void main(String args[]) { SwingUtilities.invokeLater(new Runnable() { public void run() {
Is this a known bug in Swing? Is there a standard workaround? For this, I could not find the official error report. The error is not present in Java 1.7, but my application should work on an earlier 1.5, and I would like to find a workaround that works on the latter.
Related: Modeless JDialog does not show content (does not contain sample code, so itβs hard to know if it is the same error)
The specific version of Java on which I found the error is 1.5.0_22.
source share