The information in this article applies to:
SYMPTOMSWhen adding a component using a null constraint the following error message is appears: This occurs when using a BorderLayout manager and calling the add(Component) method without passing a constraint. NOTE: The error message is displayed but the application continues to run. CAUSEIn the JDK 1.02 model, BorderLayout allowed you to add components with null constraints and then resize the components later. In the JDK 1.1 model, if you use a null constraint, it is treated as "Center" and the previously added "Center" component will be removed from the container. Implementing the JDK 1.1 model breaks existing JDK 1.02 applications that rely on this behavior. Microsoft's implementation of BorderLayout follows the JDK 1.02 implementation. RESOLUTIONIf you are writing a JDK 1.1 application, pass a constraint of "Center" instead of using a null constraint. For example the statement
would become
STATUSThis behavior is by design. MORE INFORMATIONThe sample code below demonstrates a typical JDK 1.02 application. To avoid the error messages when running the program below, set the layout manager to 'null' instead of the default BorderLayout manger. Sample Code
Steps to Reproduce Behavior
Additional query words: awt null constraint layout
Keywords : kbcode AWTPkg |
Last Reviewed: December 31, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |