Overriding: javax.swing.JComponent
Overrides JComponent.addNotify
to register this
menu bar with the current keyboard manager.
public AccessibleContext getAccessibleContext ()
Implementing: javax.accessibility.Accessible
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
public Component getComponent ()
public MenuElement[] getSubElements ()
Implementing: 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.
public String getUIClassID ()
public
void menuSelectionChanged (
boolean isIncluded)
protected
void paintBorder (
Graphics g)
protected String paramString ()
Overriding: javax.swing.JComponent
Returns a string representation of this JMenuBar
.
This method
is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be null
.
Returns: a string representation of this JMenuBar
protected
boolean processKeyBinding (
KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
Overriding: javax.swing.JComponent
Subclassed to check all the child menus.
Parameters:
ks | | the KeyStroke queried |
e | | the KeyEvent |
condition | | one of the following values:
- JComponent.WHEN_FOCUSED
- JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
- JComponent.WHEN_IN_FOCUSED_WINDOW
|
pressed | | true if the key is pressed |
Returns: true if there was a binding to an action, and the action
was enabled
Since: 1.3
public
void processKeyEvent (
KeyEvent e,
MenuElement[] path,
MenuSelectionManager manager)
public
void processMouseEvent (
MouseEvent event,
MenuElement[] path,
MenuSelectionManager manager)
public
void removeNotify ()
Overriding: javax.swing.JComponent
Overrides JComponent.removeNotify
to unregister this
menu bar with the current keyboard manager.