Microsoft SDK for Java

Q214760 FIX: TextField and TextArea Are Not Grayed Out

The information in this article applies to:

SYMPTOMS

When making a call to the Component.disable method for an AWT TextArea or TextField, the text in the component's client area should be grayed out, but it is not.

RESOLUTION

Upgrade to a version of the Microsoft VM with a build number equal to or higher than 2613. You can find the latest Microsoft VM version by going to http://www.microsoft.com/java/ This link takes you to a site on microsoft.com.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

This bug was corrected in Microsoft VM version 2613 for Visual J++ 6.0 Tech Preview 1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Compile and run the following code. If the Microsoft VM you have was shipped with one of the products above, you will see that the text in the TextArea and TextField is not grayed out.

    If you have a version later than 2613 of the VM, you will see that the text is in fact grayed out as it should be.

    import java.awt.*;
    public class CTATest extends Frame
    {
      static CTATest app;
      public static void main(String[] args)
      {
        app = new CTATest();
        app.resize(400, 400);
        app.setLayout(new BorderLayout());
    
        TextArea ta = new TextArea();
        TextField tf = new TextField();
        app.add("North", ta);
        app.add("South", tf);
    
        ta.appendText("This String should be grayed out.");
        tf.setText("This String should be grayed out.");
    
        ta.disable();
        tf.disable();
        app.show();    
      }
    
      public boolean handleEvent(Event e)
      {
        if (e.id == Event.WINDOW_DESTROY)
        {
          CTATest.app.dispose();
          System.exit(0);
          return true;
        }
        return false;
      }
    }

REFERENCES

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

http://support.microsoft.com/support/visualj/ This link takes you to a site on microsoft.com

http://support.microsoft.com/support/java/ This link takes you to a site on microsoft.com

Additional query words:

AWTPkg, JVM

© 1999 Microsoft Corporation. All rights reserved. Terms of use.