Menus and Toolbars

This section provides brief descriptions of the menu and toolbar widgets that Nexaweb provides for Java application UI Development.

For more detailed information on any of the widgets, see the XAL Schema documentation.

A menuBar lays out components left-to-right. Primarily for use with menu, menuItem and popupMenu components for creating menus. However, you can also use it to layout other components, such as a horizontal row of buttons or radio buttons.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<menuBar>
 <menu text="File">
  <popupMenu>
   <menuItem text="Open"/>
   <menuItem text="Close"/>
   <menuItem text="Preferences">
    <popupMenu>
     <menuItem text="A preference"/>
     <menuItem text="A different preference"/>
    </popupMenu>
   </menuItem>
  </popupMenu>
 </menu>
 <menu text="Edit">
  <popupMenu>
   <menuItem text="Cut"/>
   <menuItem text="Copy"/>
   <horizontalSeparator/>
   <menuItem text="Paste"/>
  </popupMenu>
 </menu>
 <menu disabled="true" text="Format">
  <popupMenu>
   <menuItem text="Cut"/>
   <menuItem text="Copy"/>
  <menuItem text="Paste"/>
  </popupMenu>
 </menu>
 <menu text="Run">
  <popupMenu>
   <menuItem text="Open"/>
   <menuItem text="Close"/>
   <menuItem text="Preferences..."/>
  </popupMenu>
 </menu>
</menuBar>

A menu is a styled button with a child popupMenu. When a user presses the button, the UI displays a popupMenu. Use menu pirmarily in a menuBar; however, you can also use it on its own to create a popup list.

Nexaweb Studio does not include menu as a standalone drag and drop widget in the Palette view but as an embedded component in the menuBar widget.

Example XAL for using this widget in a freePane:

<menu text="File">
  <popupMenu>
   <menuItem text="Open"/>
   <menuItem text="Close"/>
   <menuItem text="Preferences"/>
  </popupMenu>
</menu>

Use menuItem in a popupMenu. A menuItem is a selection in a menu. To create a sub-menu, add a popupMenu to the menu.

Nexaweb Studio does not include menuItem as a standalone drag and drop widget in the Palette view but as an embedded component in the menuBar widget.

A popupMenu is a popup that contains menuItems and sub-menus.

Nexaweb Studio does not include popupMenu as a standalone drag and drop widget in the Palette view but as an embedded component in the menuBar widget.

A list of buttons displayed horizontally that provide access to application functionality.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<horizontalToolBar height="25px" width="200px" x="50px" y="140px">
  <button text="Button 1"/>
  <button text="Button 2"/>
</horizontalToolBar>

A list of buttons displayed vertically that provide access to application functionality.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<verticalToolBar height="200px" width="50px" x="50px" y="210px">
  <button text="Button 1"/>
  <button text="Button 2"/>
</verticalToolBar>

A horizontal line to separate UI components such as items in a menu.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

 <horizontalSeparator height="5px" width="100px" x="150px" y="310px"/> 

As used in a menuBar:

<menuBar x="70px" y="120px">
  <menu text="Edit">
   <popupMenu>
    <menuItem text="Cut"/>
    <menuItem text="Copy"/>
    <horizontalSeparator/>
    <menuItem text="Paste"/>
   </popupMenu>
   </menu>
</menuBar>

A vertical line to separate UI components such as groups in a toolbar.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<verticalSeparator height="100px" width="5px" x="210px" y="230px"/>

As used in a verticalToolbar:

<verticalToolBar height="200px" width="50px" x="50px" y="210px">
  <button text="Button 1"/>
  <verticalSeparator/>
  <button text="Button 2"/>
  <verticalSeparator/>
</verticalToolBar>