-
Bug
-
Resolution: Fixed
-
P4
-
11, 15, 16
-
b17
-
generic
-
generic
The JList and JTable constructors both set the opaque property of the component to true using setOpaque(true), which has the side-effect of setting the OPAQUE_SET flag to true, which has the effect of preventing setUIProperty from clearing the property. As the opaque property was not set by the client program, setUIProperty should work.
package test;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
public class TestOpaqueListTable
{
public TestOpaqueListTable()
{
JList list = new JList();
LookAndFeel.installProperty(list, "opaque", false);
if (list.isOpaque()) {
System.err.println("Failed to clear JList opaque");
}
JTable table = new JTable();
LookAndFeel.installProperty(table, "opaque", false);
if (table.isOpaque()) {
System.err.println("Failed to clear JTable opaque");
}
}
public static void main(String[] args)
{
SwingUtilities.invokeLater(TestOpaqueListTable::new);
}
}
package test;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
public class TestOpaqueListTable
{
public TestOpaqueListTable()
{
JList list = new JList();
LookAndFeel.installProperty(list, "opaque", false);
if (list.isOpaque()) {
System.err.println("Failed to clear JList opaque");
}
JTable table = new JTable();
LookAndFeel.installProperty(table, "opaque", false);
if (table.isOpaque()) {
System.err.println("Failed to clear JTable opaque");
}
}
public static void main(String[] args)
{
SwingUtilities.invokeLater(TestOpaqueListTable::new);
}
}