Java javax.swing JMenuBar fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JMenuBar fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JMenuBar.

The text is from its open source code.

Subclass

javax.swing.JMenuBar has subclasses.
Click this link to see all its subclasses.

Constructor

JMenuBar()
Creates a new menu bar.

Method

JMenuadd(JMenu c)
Appends the specified menu to the end of the menu bar.
Componentadd(String name, Component comp)
Adds the specified component to this container.
voidaddNotify()
Overrides JComponent.addNotify to register this menu bar with the current keyboard manager.
ComponentgetComponent()
Implemented to be a MenuElement.
ComponentgetComponent(int n)
Gets the nth component in this container.
intgetComponentCount()
Gets the number of components in this panel.
intgetComponentIndex(Component c)
Returns the index of the specified component.
Component[]getComponents()
Gets all the components in this container.
JMenugetHelpMenu()
Gets the help menu for the menu bar.
InsetsgetMargin()
Returns the margin between the menubar's border and its menus.
JMenugetMenu(int index)
Returns the menu at the specified position in the menu bar.
intgetMenuCount()
Returns the number of items in the menu bar.
DimensiongetPreferredSize()
If the preferredSize has been set to a non-null value just returns it.
SingleSelectionModelgetSelectionModel()
Returns the model object that handles single selections.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
MenuElement[]getSubElements()
Implemented to be a MenuElement -- returns the menus in this menu bar.
booleanisBorderPainted()
Returns true if the menu bars border should be painted.
booleanisSelected()
Returns true if the menu bar currently has a component selected.
voidmenuSelectionChanged(boolean isIncluded)
Implemented to be a MenuElement -- does nothing.
voidpaint(Graphics g)
Invoked by Swing to draw components.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidremove(int index)
Removes the component, specified by index , from this container.
voidremoveAll()
Removes all the components from this container.
voidremoveNotify()
Overrides JComponent.removeNotify to unregister this menu bar with the current keyboard manager.
voidrevalidate()
Supports deferred automatic layout.
voidsetAlignmentX(float alignmentX)
Sets the horizontal alignment.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBorderPainted(boolean b)
Sets whether the border should be painted.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetForeground(Color fg)
Sets the foreground color of this component.
voidsetHelpMenu(JMenu menu)
Sets the help menu that appears when the user selects the "help" option in the menu bar.
voidsetLayout(LayoutManager mgr)
Sets the layout manager for this container.
voidsetMargin(Insets m)
Sets the margin between the menubar's border and its menus.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetSelected(Component sel)
Sets the currently selected component, producing a a change to the selection model.
voidsetSize(Dimension d)
Resizes this component so that it has width d.width and height d.height .
voidsetVisible(boolean aFlag)
Makes the component visible or invisible.
voidvalidate()
Validates this container and all of its subcomponents.