JMainMenu Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

This property provides a scripting interface to the main menu created with the Java Development Kit.

Supported component versions: Java 7, 8, 11 and 17.

Declaration

TestObj.JMainMenu

Read-Only Property A Menu object
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

View Mode

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Property Value

A Menu object that corresponds to the Java main menu.

Remarks

After you obtain the menu, you can select items from this menu using the returned object. See the Menu object description for more information on available menu actions.

There are two ways to obtain the main menu of a Java application:

  1. Via the Window.JMainMenu property.
  2. Via the JMenuBar.SwingMenu property.

Accessing the menu through the JMainMenu of a Window object is convenient, however if a window has several menus, you might encounter recognition problems. In this case you should use the JMenuBar object. The instances of this object are available for every menu bar of a Java application and addressing the instance that corresponds to the main menu solves the problem.

This property is available if the Java Control Support plugin is installed.

See Also

MainMenu Property
PopupMenu Property (Window Objects)
SwingPopupMenu Property
SystemMenu Property
Java Swing Menu Bar Support
Simulating Menu Actions

Highlight search results