Details
-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b27
-
x86
-
windows_7
Description
FULL PRODUCT VERSION :
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
DefaultTreeCellRenderer always paint it's background, even if LAF property 'Tree.rendererFillBackground' has been set to false. This is especially the case with Nimbus LAF, which sets 'Tree.rendererFillBackground' to false by default.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Regarding the LAF property 'Tree.rendererFillBackground', the tree cells should be rendered
- opaque, if the property has been set to true
- non-opaque, if the property has been set to false
ACTUAL -
The tree cells are always rendered opaque.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String...args)
{
try
{
UIManager.setLookAndFeel( "javax.swing.plaf.nimbus.NimbusLookAndFeel" );
UIManager.put("Tree.rendererFillBackground",Boolean.FALSE);
UIManager.put("Tree.textBackground", Color.RED);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
for (int i=0; i<3; i++)
{
DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Node " + i);
root.add(node1);
for (int j=0; j<3; j++)
{
node1.add(new DefaultMutableTreeNode("Node " + i + "." + j));
}
}
JTree tree = new JTree(root);
tree.setCellRenderer( new DefaultTreeCellRenderer() );
JFrame frame = new JFrame("DefaultTreeCellRenderer Bug Demo");
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.getContentPane().setLayout( new BorderLayout() );
frame.getContentPane().add( new JScrollPane(tree) );
frame.setSize( 600, 400 );
frame.setVisible( true );
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
}
---------- END SOURCE ----------
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
DefaultTreeCellRenderer always paint it's background, even if LAF property 'Tree.rendererFillBackground' has been set to false. This is especially the case with Nimbus LAF, which sets 'Tree.rendererFillBackground' to false by default.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Regarding the LAF property 'Tree.rendererFillBackground', the tree cells should be rendered
- opaque, if the property has been set to true
- non-opaque, if the property has been set to false
ACTUAL -
The tree cells are always rendered opaque.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String...args)
{
try
{
UIManager.setLookAndFeel( "javax.swing.plaf.nimbus.NimbusLookAndFeel" );
UIManager.put("Tree.rendererFillBackground",Boolean.FALSE);
UIManager.put("Tree.textBackground", Color.RED);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
for (int i=0; i<3; i++)
{
DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Node " + i);
root.add(node1);
for (int j=0; j<3; j++)
{
node1.add(new DefaultMutableTreeNode("Node " + i + "." + j));
}
}
JTree tree = new JTree(root);
tree.setCellRenderer( new DefaultTreeCellRenderer() );
JFrame frame = new JFrame("DefaultTreeCellRenderer Bug Demo");
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.getContentPane().setLayout( new BorderLayout() );
frame.getContentPane().add( new JScrollPane(tree) );
frame.setSize( 600, 400 );
frame.setVisible( true );
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
}
---------- END SOURCE ----------