








Technical Support
AntiVirus Updates
File Downloads
Personalized Support
Chat Now!
Knowledge Base
Ask a Tech
Data Recovery
News Bulletins
Register Software
Address Change
Disk/Manual Replacement
Return Status
Rebate Status
Order Status
Upgrade Status
Telephone Support






© 1995-1999 Symantec Corporation All rights reserved.
|
|
VisualCafé Professional Edition 3.0 for Windows Knowledge Base
Accessing the Name Property of the java.awt.Component Class
Situation:
You developed a Java application or Applet using Visual Cafe's visual design environment (IDDE). You noticed that in the IDDE's Property List, changing the "Name" property affects only the name of the variable used for a Component instance in the generated code, instead of the "real" name of the object, the java.awt.Component.Name field. You would like to know how to change the name of the Component, rather than the name of its instance variable.
Solution:
In classes derived from java awt.Component, java.awt.Component.Name is exposed via the getName() and setName() methods. Use these methods to work around the problem in one of the following ways: - Call the java.awt.Component.getName() and java.awt.Component.setName() methods manually from the source code. (Be carefuI about making changes in the INIT_CONTROLS and DECLARE_CONTROLS blocks.) If this is a viable option for you, it is much easier than the following solution.
- Modify or extend the component in question so that it includes a "Component Name" property, which acts as a "proxy" for the underlying java.awt.Component.Name. The accessor/manipulator methods for the new property (getComponentName() and setComponentName() if you follow JavaBean naming conventions) simply call the getName() and setName() methods provided by the java.awt.Component class.
For more information regarding how to create Beans in Visual Cafe, refer to Chapter 6 of the User's Guide. For more information regarding Beans in general, please refer to the Java Beans Specification.

Product(s): Visual Café for Java(tm) dbDE 2.0 - Mac, Visual Café for Java(tm) dbDE 2.0 - Win95/NT, Visual Café for Java(tm) dbDE 2.5 - Win95/NT, Visual Café for Java(tm) PDE 2.0 - Mac, Visual Café for Java(tm) PDE 2.0 - Win95/NT, Visual Café for Java(tm) PDE 2.5 - Win95/NT, Visual Café for Java(tm) WDE 2.0 - Win95/NT, Visual Café Pro 1.1 - Win95/NT, Visual Café Standard Edition 3.0 - Win9x/NT, Visual Café Professional Edition 3.0 - Win9x/NT, Visual Café Enterprise Suite 3.0 - Win9x/NT, Visual Café Database Edition 3.0 - Win9x/NT
Operating Systems(s): All Supported
Document ID: 199851810753
Date Created: 05/18/98
Last Modified: 06/18/99
|