FIX: TextField and TextArea Are Not Grayed Out on Call to Component.disable()

ID: Q214760


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 virtual machine (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/ and following the "downloads" link on the left.


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 virtual machine 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. Refer to the following article in the Microsoft Knowledge Base to find which versions of the Microsoft VM shipped with what products:
    Q169803 INFO: Historical List of Shipping Vehicles for Microsoft VM

    If you have a version later than 2613 of the Microsoft 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/

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


© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Robert LaCasse, Microsoft Corporation

Additional query words: AWTPkg, Microsoft VM ,


Keywords          : kbSDKJava150fix kbVJ110fix kbGrpJava 
Version           : WINDOWS:1.0,1.1,1.5,1.51,2.0,2.01,2.02
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 28, 1999