Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4853457
Votes 1
Synopsis REGRESSION: List setEnabled(true) does not redraw Items on Windows 2000
Category java:classes_awt
Reported Against mantis-beta
Release Fixed mustang(b40)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 24-APR-2003
Description




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  customer  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) 
======================================================================
Work Around
N/A
Evaluation
Commit to fix in Tiger. 
  xxxxx@xxxxx   2003-04-24

The problem is that the list wrapper window does not forward WM_ENABLE to list control itself, thus preventing it from repainting. We should either repaint the list box on WM_ENABLE in wrapper wndproc, or forward the message to list control (I prefer the latter option).
  xxxxx@xxxxx   2005-03-18 18:19:04 GMT
Comments
  
  Include a link with my name & email   

Submitted On 24-JUL-2003
k.k.1
Bug still occurs on java version "1.4.2"


Submitted On 28-FEB-2004
jneffenger
The bug also occurs on the latest Windows XP (Version
5.1.2600) and Java 1.5.0 Beta 1 (build 1.5.0-beta-b32c) --
not just on Windows 2000.


Submitted On 28-FEB-2004
jneffenger
Bug still occurs in Java 1.5.0 Beta 1 on Windows 2000:

java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)


Submitted On 15-MAY-2007
This bug still occurs on jdk1.5.0_11.

The workaround still works, though.



PLEASE NOTE: JDK6 is formerly known as Project Mustang