All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JMenuBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JMenuBar

public class JMenuBar
extends JComponent
An implementation of a MenuBar


Variable Index

 o selectionModel
Model for the selected subcontrol

Constructor Index

 o JMenuBar()

Method Index

 o add(JMenu)
 o deleteShortcut(MenuShortcut)
 o getComponentAt(int, int)
Returns the subcomponent at the given coordinates in this menubar's coordinate space.
 o getComponentAtIndex(int)
 o getComponentIndex(Component)
 o getHelpMenu()
 o getMenu(int)
 o getMenuCount()
 o getSelectionModel()
 o getShortcutMenuItem(MenuShortcut)
 o getShortcuts()
 o getTranslatedPoint(int, int, Component, Component)
Returns the given point in the from components coordinate space translated into the to components coordinate space.
 o getUI()
Returns the menubar's current UI.
 o isBorderPainted()
 o isOpaque()
 o isSelected()
 o remove(int)
 o setBorderPainted(boolean)
 o setHelpMenu(JMenu)
 o setSelected(Component)
 o setSelectionModel(SingleSelectionModel)
 o setUI(MenuBarUI)
Sets the menubar's UI.
 o setVisible(boolean)
 o updateUI()
Gets a new UI object from the default UIFactory.

Variables

 o selectionModel
 protected SingleSelectionModel selectionModel
Model for the selected subcontrol

Constructors

 o JMenuBar
 public JMenuBar()

Methods

 o getUI
 public MenuBarUI getUI()
Returns the menubar's current UI.

See Also:
setUI
 o setUI
 public void setUI(MenuBarUI ui)
Sets the menubar's UI.

Parameters:
ui - the new MenuBarUI
See Also:
getUI
 o updateUI
 public void updateUI()
Gets a new UI object from the default UIFactory.

Overrides:
updateUI in class JComponent
 o getSelectionModel
 public SingleSelectionModel getSelectionModel()
 o setSelectionModel
 public void setSelectionModel(SingleSelectionModel model)
 o add
 public JMenu add(JMenu c)
 o getMenu
 public JMenu getMenu(int index)
 o getMenuCount
 public int getMenuCount()
 o remove
 public void remove(int index)
Overrides:
remove in class Container
 o setHelpMenu
 public void setHelpMenu(JMenu menu)
 o getHelpMenu
 public JMenu getHelpMenu()
 o getShortcutMenuItem
 public JMenuItem getShortcutMenuItem(MenuShortcut m)
 o getShortcuts
 public Enumeration getShortcuts()
 o deleteShortcut
 public void deleteShortcut(MenuShortcut m)
 o setVisible
 public void setVisible(boolean b)
Overrides:
setVisible in class Component
 o getComponentAtIndex
 public Component getComponentAtIndex(int i)
 o getComponentAt
 public Component getComponentAt(int x,
                                 int y)
Returns the subcomponent at the given coordinates in this menubar's coordinate space.

Overrides:
getComponentAt in class Container
 o getComponentIndex
 public int getComponentIndex(Component c)
 o getTranslatedPoint
 public Point getTranslatedPoint(int x,
                                 int y,
                                 Component from,
                                 Component to)
Returns the given point in the from components coordinate space translated into the to components coordinate space. The from component is expected to be a menu-parent of the to component.

 o setSelected
 public void setSelected(Component sel)
 o isSelected
 public boolean isSelected()
 o isBorderPainted
 public boolean isBorderPainted()
 o setBorderPainted
 public void setBorderPainted(boolean s)
 o isOpaque
 public boolean isOpaque()
Overrides:
isOpaque in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index