Liking cljdoc? Tell your friends :D

javax.swing.JMenuBar

An implementation of a menu bar. You add JMenu objects to the menu bar to construct a menu. When the user selects a JMenu object, its associated JPopupMenu is displayed, allowing the user to select one of the JMenuItems on it.

For information and examples of using menu bars see How to Use Menus, a section in The Java Tutorial.

Warning: Swing is not thread safe. For more information see Swing's Threading Policy.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.

Warning: By default, pressing the Tab key does not transfer focus from a JMenuBar which is added to a container together with other Swing components, because the focusTraversalKeysEnabled property of JMenuBar is set to false. To resolve this, you should call the JMenuBar.setFocusTraversalKeysEnabled(true) method.

An implementation of a menu bar. You add JMenu objects to the
menu bar to construct a menu. When the user selects a JMenu
object, its associated JPopupMenu is displayed, allowing the
user to select one of the JMenuItems on it.

For information and examples of using menu bars see
How to Use Menus,
a section in The Java Tutorial.

Warning: Swing is not thread safe. For more
information see Swing's Threading
Policy.

Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing.  As of 1.4, support for long term storage
of all JavaBeans™
has been added to the java.beans package.
Please see XMLEncoder.

Warning:
By default, pressing the Tab key does not transfer focus from a
JMenuBar which is added to a container together with other Swing
components, because the focusTraversalKeysEnabled property
of JMenuBar is set to false. To resolve this,
you should call the JMenuBar.setFocusTraversalKeysEnabled(true)
method.
raw docstring

->j-menu-barclj

(->j-menu-bar)

Constructor.

Creates a new menu bar.

Constructor.

Creates a new menu bar.
raw docstring

addclj

(add this c)

Appends the specified menu to the end of the menu bar.

c - the JMenu component to add - javax.swing.JMenu

returns: the menu component - javax.swing.JMenu

Appends the specified menu to the end of the menu bar.

c - the JMenu component to add - `javax.swing.JMenu`

returns: the menu component - `javax.swing.JMenu`
raw docstring

add-notifyclj

(add-notify this)

Overrides JComponent.addNotify to register this menu bar with the current keyboard manager.

Overrides JComponent.addNotify to register this
menu bar with the current keyboard manager.
raw docstring

border-painted?clj

(border-painted? this)

Returns true if the menu bars border should be painted.

returns: true if the border should be painted, else false - boolean

Returns true if the menu bars border should be painted.

returns: true if the border should be painted, else false - `boolean`
raw docstring

get-accessible-contextclj

(get-accessible-context this)

Gets the AccessibleContext associated with this JMenuBar. For JMenuBars, the AccessibleContext takes the form of an AccessibleJMenuBar. A new AccessibleJMenuBar instance is created if necessary.

returns: an AccessibleJMenuBar that serves as the AccessibleContext of this JMenuBar - javax.accessibility.AccessibleContext

Gets the AccessibleContext associated with this JMenuBar.
 For JMenuBars, the AccessibleContext takes the form of an
 AccessibleJMenuBar.
 A new AccessibleJMenuBar instance is created if necessary.

returns: an AccessibleJMenuBar that serves as the
         AccessibleContext of this JMenuBar - `javax.accessibility.AccessibleContext`
raw docstring

get-componentclj

(get-component this)

Implemented to be a MenuElement. Returns this object.

returns: the current Component (this) - java.awt.Component

Implemented to be a MenuElement. Returns this object.

returns: the current Component (this) - `java.awt.Component`
raw docstring

get-component-at-indexclj

(get-component-at-index this i)

Deprecated. replaced by getComponent(int i)

i - an integer specifying the position, where 0 is first - int

returns: the Component at the position, or null for an invalid index - java.awt.Component

Deprecated. replaced by getComponent(int i)

i - an integer specifying the position, where 0 is first - `int`

returns: the Component at the position,
          or null for an invalid index - `java.awt.Component`
raw docstring

get-component-indexclj

(get-component-index this c)

Returns the index of the specified component.

c - the Component to find - java.awt.Component

returns: an integer giving the component's position, where 0 is first; or -1 if it can't be found - int

Returns the index of the specified component.

c - the Component to find - `java.awt.Component`

returns: an integer giving the component's position, where 0 is first;
          or -1 if it can't be found - `int`
raw docstring

get-help-menuclj

(get-help-menu this)

Gets the help menu for the menu bar. This method is not yet implemented and will throw an exception.

returns: the JMenu that delivers help to the user - javax.swing.JMenu

Gets the help menu for the menu bar.  This method is not yet
 implemented and will throw an exception.

returns: the JMenu that delivers help to the user - `javax.swing.JMenu`
raw docstring

get-marginclj

(get-margin this)

Returns the margin between the menubar's border and its menus. If there is no previous margin, it will create a default margin with zero size.

returns: an Insets object containing the margin values - java.awt.Insets

Returns the margin between the menubar's border and
 its menus.  If there is no previous margin, it will create
 a default margin with zero size.

returns: an Insets object containing the margin values - `java.awt.Insets`
raw docstring

get-menuclj

(get-menu this index)

Returns the menu at the specified position in the menu bar.

index - an integer giving the position in the menu bar, where 0 is the first position - int

returns: the JMenu at that position, or null if if there is no JMenu at that position (ie. if it is a JMenuItem) - javax.swing.JMenu

Returns the menu at the specified position in the menu bar.

index - an integer giving the position in the menu bar, where 0 is the first position - `int`

returns: the JMenu at that position, or null if
          if there is no JMenu at that position (ie. if
          it is a JMenuItem) - `javax.swing.JMenu`
raw docstring

get-menu-countclj

(get-menu-count this)

Returns the number of items in the menu bar.

returns: the number of items in the menu bar - int

Returns the number of items in the menu bar.

returns: the number of items in the menu bar - `int`
raw docstring

get-selection-modelclj

(get-selection-model this)

Returns the model object that handles single selections.

returns: the SingleSelectionModel property - javax.swing.SingleSelectionModel

Returns the model object that handles single selections.

returns: the SingleSelectionModel property - `javax.swing.SingleSelectionModel`
raw docstring

get-sub-elementsclj

(get-sub-elements this)

Implemented to be a MenuElement -- returns the menus in this menu bar. This is the reason for implementing the MenuElement interface -- so that the menu bar can be treated the same as other menu elements.

returns: an array of menu items in the menu bar. - javax.swing.MenuElement[]

Implemented to be a MenuElement -- returns the
 menus in this menu bar.
 This is the reason for implementing the MenuElement
 interface -- so that the menu bar can be treated the same as
 other menu elements.

returns: an array of menu items in the menu bar. - `javax.swing.MenuElement[]`
raw docstring

get-uiclj

(get-ui this)

Returns the menubar's current UI.

returns: javax.swing.plaf.MenuBarUI

Returns the menubar's current UI.

returns: `javax.swing.plaf.MenuBarUI`
raw docstring

get-ui-class-idclj

(get-ui-class-id this)

Returns the name of the L&F class that renders this component.

returns: the string "MenuBarUI" - java.lang.String

Returns the name of the L&F class that renders this component.

returns: the string "MenuBarUI" - `java.lang.String`
raw docstring

(menu-selection-changed this is-included)

Implemented to be a MenuElement -- does nothing.

is-included - boolean

Implemented to be a MenuElement -- does nothing.

is-included - `boolean`
raw docstring

process-key-eventclj

(process-key-event this e path manager)

Implemented to be a MenuElement -- does nothing.

e - java.awt.event.KeyEvent path - javax.swing.MenuElement[] manager - javax.swing.MenuSelectionManager

Implemented to be a MenuElement -- does nothing.

e - `java.awt.event.KeyEvent`
path - `javax.swing.MenuElement[]`
manager - `javax.swing.MenuSelectionManager`
raw docstring

process-mouse-eventclj

(process-mouse-event this event path manager)

Implemented to be a MenuElement -- does nothing.

event - java.awt.event.MouseEvent path - javax.swing.MenuElement[] manager - javax.swing.MenuSelectionManager

Implemented to be a MenuElement -- does nothing.

event - `java.awt.event.MouseEvent`
path - `javax.swing.MenuElement[]`
manager - `javax.swing.MenuSelectionManager`
raw docstring

remove-notifyclj

(remove-notify this)

Overrides JComponent.removeNotify to unregister this menu bar with the current keyboard manager.

Overrides JComponent.removeNotify to unregister this
menu bar with the current keyboard manager.
raw docstring

selected?clj

(selected? this)

Returns true if the menu bar currently has a component selected.

returns: true if a selection has been made, else false - boolean

Returns true if the menu bar currently has a component selected.

returns: true if a selection has been made, else false - `boolean`
raw docstring

set-border-paintedclj

(set-border-painted this b)

Sets whether the border should be painted.

b - if true and border property is not null, the border is painted. - boolean

Sets whether the border should be painted.

b - if true and border property is not null, the border is painted. - `boolean`
raw docstring

set-help-menuclj

(set-help-menu this menu)

Sets the help menu that appears when the user selects the "help" option in the menu bar. This method is not yet implemented and will throw an exception.

menu - the JMenu that delivers help to the user - javax.swing.JMenu

Sets the help menu that appears when the user selects the
 "help" option in the menu bar. This method is not yet implemented
 and will throw an exception.

menu - the JMenu that delivers help to the user - `javax.swing.JMenu`
raw docstring

set-marginclj

(set-margin this m)

Sets the margin between the menubar's border and its menus. Setting to null will cause the menubar to use the default margins.

m - an Insets object containing the margin values - java.awt.Insets

Sets the margin between the menubar's border and
 its menus. Setting to null will cause the menubar to
 use the default margins.

m - an Insets object containing the margin values - `java.awt.Insets`
raw docstring

set-selectedclj

(set-selected this sel)

Sets the currently selected component, producing a a change to the selection model.

sel - the Component to select - java.awt.Component

Sets the currently selected component, producing a
 a change to the selection model.

sel - the Component to select - `java.awt.Component`
raw docstring

set-selection-modelclj

(set-selection-model this model)

Sets the model object to handle single selections.

model - the SingleSelectionModel to use - javax.swing.SingleSelectionModel

Sets the model object to handle single selections.

model - the SingleSelectionModel to use - `javax.swing.SingleSelectionModel`
raw docstring

set-uiclj

(set-ui this ui)

Sets the L&F object that renders this component.

ui - the new MenuBarUI L&F object - javax.swing.plaf.MenuBarUI

Sets the L&F object that renders this component.

ui - the new MenuBarUI L&F object - `javax.swing.plaf.MenuBarUI`
raw docstring

update-uiclj

(update-ui this)

Resets the UI property with a value from the current look and feel.

Resets the UI property with a value from the current look and feel.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close