-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b40
-
x86
-
windows_2000
Name: rmT116609 Date: 04/24/2003
FULL PRODUCT VERSION :
Bug occurs on all versions since "1.4.0_02":
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
FULL OS VERSION :
Bug occurs on Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 1, SP2 and SP3
EXTRA RELEVANT SYSTEM CONFIGURATION :
Bug occurs on
Ati Rage Fury Pro (Driver-Version 5.0.0.139)
Ati Rage XL AGP 2X (Driver-Version 5.0.2195.1)
Matrox G550 DualHead (Driver-Version 5.72.21.0)
Ati 3D Rage Pro AGP 2X (Driver-Version 5.0.2195.1)
A DESCRIPTION OF THE PROBLEM :
A visible java.awt.List which is
1. setEnabled(false)
2. filled with 50 Items (Strings)
3. setEnabled(true)
does not change the item foreground color back from gray to black on Windows 2000.
But the items in the gray-colored List can be selected. Once selected and deselected again by the user, the item (the String) is black.
The described error occurs with versions
- java version "1.4.0_02"
- java version "1.4.1"
- java version "1.4.1_01"
- java version "1.4.1_02"
- java version "1.4.2_beta"
The error does not occur with versions
- java version "1.1.8_010"
- java version "1.3.1"
- java version "1.4.0"
- java version "1.4.0_01"
Searching for differences between versions "1.4.0" and "1.4.0_02" I found the "fixed"
Bug 4096745 : Calling disable() or enable() made AWT components blink.
I think that this bug is a regression of bug 4096745.
I can neither reproduce this error on Windows NT (SP3,5,6), nor on Linux, so maybe it only happens in combination with the "Windows 2000 Compatibility Issues" how to set the foreground window.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the example program and see gray-colored Items in the List.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Items in java.awt.List should get the foreground color black if the List is enabled.
Items in java.awt.List remain gray-colored. If the List is resized or the items are selected by the user, the items become black (->redraw-bug?).
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no messages
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
public class GrayList
{
public static void main (String args[])
{
Frame myFrame = new Frame();
// create List
List myList = new List(10);
// add List to the Frame
myFrame.add(myList);
// show Frame on screen
myFrame.pack();
myFrame.setVisible(true);
// disable List
myList.setEnabled(false);
// fill List
for ( int i = 0 ; i<50 ; i++ )
{
String myString = new String("Teststring" + i);
// add String to the List
myList.add( myString );
}
// enable List
myList.setEnabled(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I found a workaround in Bug 4511696:
While calls to repaint(), or attempts to call paint() or update()
directly are of no use, doing...
// enable List
myList.setEnabled(true);
// and set the Font
myList.setFont( myList.getFont() );
...will force the List to refresh.
Release Regression From : 1.4.0_01
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 184741)
======================================================================