BUG: Text Components Are Not Brighter for Editable Controls

Last reviewed: January 29, 1998
Article ID: Q178645
The information in this article applies to:
  • SDK for Java, versions 2.0, 2.01
  • Microsoft Win32 Virtual Machine for Java
  • Microsoft Internet Explorer versions 4.0, 4.01 for Windows 95
  • Microsoft Internet Explorer versions 4.0, 4.01 for Windows NT 4.0

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. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

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 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 page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/visualj/
   http://support.microsoft.com/support/java/

Keywords          : kbcode AWTPkg JAFC JVM
Technology        : kbInetDev internet
Version           : WINDOWS:2.0,2.01,4.0,4.01
Platform          : WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 29, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.