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
- implements Accessible
An implementation of a MenuBar
-
JMenuBar()
-
-
add(JMenu)
-
-
deleteShortcut(MenuShortcut)
-
-
getAccessibleRole()
- Get the role of this object.
-
getAccessibleStateSet()
- Get the accessible state set of this object.
-
getComponentAtIndex(int)
-
-
getComponentIndex(Component)
-
-
getHelpMenu()
-
-
getMargin()
- Returns the margin between the menubar's border and
its menus.
-
getMenu(int)
-
-
getMenuCount()
-
-
getSelectionModel()
-
-
getShortcutMenuItem(MenuShortcut)
-
-
getShortcuts()
-
-
getUI()
- Returns the menubar's current UI.
-
getUIClassID()
-
-
isBorderPainted()
-
-
isManagingFocus()
- Override this method and return true if your JComponent manages focus.
-
isOpaque()
- Returns true if this component is completely opaque.
-
isSelected()
-
-
paintBorder(Graphics)
- Paint the menubar's border if BorderPainted property is true.
-
remove(int)
-
-
setBorderPainted(boolean)
-
-
setHelpMenu(JMenu)
-
-
setMargin(Insets)
- Sets the margin between the menubar's border and
its menus.
-
setSelected(Component)
-
-
setSelectionModel(SingleSelectionModel)
-
-
setUI(MenuBarUI)
- Sets the menubar's UI.
-
updateUI()
- Gets a new UI object from the default UIFactory.
JMenuBar
public JMenuBar()
getUI
public MenuBarUI getUI()
- Returns the menubar's current UI.
- See Also:
- setUI
setUI
public void setUI(MenuBarUI ui)
- Sets the menubar's UI.
- Parameters:
- ui - the new MenuBarUI
- See Also:
- getUI
updateUI
public void updateUI()
- Gets a new UI object from the default UIFactory.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "MenuBarUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
getSelectionModel
public SingleSelectionModel getSelectionModel()
setSelectionModel
public void setSelectionModel(SingleSelectionModel model)
add
public JMenu add(JMenu c)
getMenu
public JMenu getMenu(int index)
getMenuCount
public int getMenuCount()
remove
public void remove(int index)
- Overrides:
- remove in class Container
setHelpMenu
public void setHelpMenu(JMenu menu)
getHelpMenu
public JMenu getHelpMenu()
getShortcutMenuItem
public JMenuItem getShortcutMenuItem(MenuShortcut m)
getShortcuts
public Enumeration getShortcuts()
deleteShortcut
public void deleteShortcut(MenuShortcut m)
getComponentAtIndex
public Component getComponentAtIndex(int i)
getComponentIndex
public int getComponentIndex(Component c)
setSelected
public void setSelected(Component sel)
isSelected
public boolean isSelected()
isBorderPainted
public boolean isBorderPainted()
setBorderPainted
public void setBorderPainted(boolean s)
paintBorder
protected void paintBorder(Graphics g)
- Paint the menubar's border if BorderPainted property is true.
- Overrides:
- paintBorder in class JComponent
- See Also:
- paint, setBorder
setMargin
public void setMargin(Insets margin)
- Sets the margin between the menubar's border and
its menus. Setting to null will cause the menubar to
use the default margins.
getMargin
public Insets getMargin()
- Returns the margin between the menubar's border and
its menus.
isOpaque
public boolean isOpaque()
- Returns true if this component is completely opaque.
- Overrides:
- isOpaque in class JComponent
getAccessibleStateSet
public AccessibleStateSet getAccessibleStateSet()
- Get the accessible state set of this object.
- Returns:
- an instance of AccessibleState containing the current state
of the object
- Overrides:
- getAccessibleStateSet in class JComponent
getAccessibleRole
public AccessibleRole getAccessibleRole()
- Get the role of this object.
- Returns:
- an instance of AccessibleRole describing the role of the object
- Overrides:
- getAccessibleRole in class JComponent
isManagingFocus
public boolean isManagingFocus()
- Override this method and return true if your JComponent manages focus.
- Overrides:
- isManagingFocus in class JComponent
All Packages Class Hierarchy This Package Previous Next Index