Description
The JavaClassName
property returns the short class name of an object of a Java application that was created with AWT, Swing, SWT or WFC libraries. Examples of short class names are JMenuBar
or JButton
.
If the object is an array, JavaClassName
contains the brackets at the end of the returned string, for instance, if JavaAppObject is an array of components, the property will return Component[]
. The number of brackets correspond to the array dimensions. For instance, if JavaAppObject is an array that has three dimensions, the property will contain three brackets at the end: Component[][][]
.
If the object is an array of simple types such as integer, string or boolean, the JavaClassName
will return the type name and brackets, for instance, int[][]
.
To address objects of AWT, Swing and SWT Java applications, use the AWTObject
, SwingObject
or SWTObject
methods. These methods can address an object by its name, or by the class name, accessible name and index. The JavaClassName
property value is equal to the first parameter (class name) used by these methods.
Declaration
TestObj.JavaClassName
Read-Only Property | String |
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section |
Applies To
All Java application objects.
View Mode
To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Property Value
The string holding the short class name of a desired object.
Remarks
To get the object’s full class name (including the package names), use the JavaFullClassName
property.
The JavaClassName
property is only available if the Java Application Support plugin is installed and the application under test is a Java application created with AWT, Swing, SWT or WFC libraries. Otherwise, this property is absent in the object’s property list.
See Also
Testing Java Applications - Overview
JavaFullClassName Property