FIX: Text Components Are Not Brighter for Editable Controls (178645)



The information in this article applies to:

  • Microsoft Internet Explorer 4.01 for Windows NT 4.0
  • Microsoft Internet Explorer 4.0 for Windows NT 4.0
  • Microsoft Internet Explorer 4.01 for Windows 95
  • Microsoft Internet Explorer 4.0 for Windows 95
  • Microsoft SDK for Java 2.0
  • Microsoft SDK for Java 2.01
  • Microsoft virtual machine

This article was previously published under Q178645

SYMPTOMS

The java.awt.TextArea and java.awt.TextField controls do not use a brighter color when they can be edited.

CAUSE

In builds of the Virtual Machine for Java prior to 2252 a brighter color was used to represent an editable control.

RESOLUTION

See the sample code below for a potential workaround.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been fixed in Internet Explorer 4.01 Service Pack 1, and SDK for Java 2.02.

MORE INFORMATION

The sample code below illustrates the problem and a potential way to workaround the problem by calling brighter():
import com.ms.ui.*;
import java.awt.*;

class test {
  public static void main(String args[])
  {
  java.awt.Color c = new java.awt.Color(255,40,168);

  Frame f = new Frame("AWT Frame");
  f.setSize(320,200);
  f.setLayout(new GridLayout(3,0));

  TextArea edit1=new TextArea("Read Only");
  TextArea edit2=new TextArea("Editable (Should match brighter color)");
  TextArea edit3=new TextArea("Brighter");

  edit1.setBackground(c);
  edit1.setEditable(false);

  edit2.setBackground(c);
  edit2.setEditable(true);

  // workaround:  set background to brighter color.
  edit3.setBackground(c.brighter());
  edit3.setEditable(true);

  f.add(edit1);
  f.add(edit2);
  f.add(edit3);
  f.setVisible(true);
  }
}
				
NOTE: In the Application Foundation Classes (AFC), the UIEdit control does not change color when it is editable.

REFERENCES

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following pages on the Microsoft Technical Support site:

Modification Type:MinorLast Reviewed:8/25/2005
Keywords:kbBug kbcode kbfix KB178645