Class SeparatorMenuItem

All Implemented Interfaces:
Styleable, EventTarget

public class SeparatorMenuItem
extends CustomMenuItem

A MenuItem that as the name suggests allows for a horizontal Separator to be embedded within it, by assigning a Separator to the content property of the CustomMenuItem This is provided for convenience as groups of menuitems can be separated by a separator. Instead of a creating a CustomMenuItem for this purpose, the user can use this class as indicated below.

MenuItem item1 = new MenuItem("Item1");
MenuItem item2 = new MenuItem("Item2");
SeparatorMenuItem separator = new SeparatorMenuItem();

Menu menu = new Menu("Items");
menu.getItems().addAll(item1, separator, item2);
MenuBar menuBar = new MenuBar(menu);
Image of the SeparatorMenuItem control
JavaFX 2.0
See Also:
CustomMenuItem, MenuItem, Menu
  • Constructor Details

    • SeparatorMenuItem

      public SeparatorMenuItem()
      Creates a default SeparatorMenuItem instance.