Example usage for Java javax.swing JMenuBar fields, constructors, methods, implement or subclass
The text is from its open source code.
JMenuBar() Creates a new menu bar. |
JMenu | add(JMenu c) Appends the specified menu to the end of the menu bar. |
Component | add(String name, Component comp) Adds the specified component to this container. |
void | addNotify() Overrides JComponent.addNotify to register this menu bar with the current keyboard manager. |
Component | getComponent() Implemented to be a MenuElement . |
Component | getComponent(int n) Gets the nth component in this container. |
int | getComponentCount() Gets the number of components in this panel. |
int | getComponentIndex(Component c) Returns the index of the specified component. |
Component[] | getComponents() Gets all the components in this container. |
JMenu | getHelpMenu() Gets the help menu for the menu bar. |
Insets | getMargin() Returns the margin between the menubar's border and its menus. |
JMenu | getMenu(int index) Returns the menu at the specified position in the menu bar. |
int | getMenuCount() Returns the number of items in the menu bar. |
Dimension | getPreferredSize() If the preferredSize has been set to a non-null value just returns it. |
SingleSelectionModel | getSelectionModel() Returns the model object that handles single selections. |
Dimension | getSize() 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. |
boolean | isBorderPainted() Returns true if the menu bars border should be painted. |
boolean | isSelected() Returns true if the menu bar currently has a component selected. |
void | menuSelectionChanged(boolean isIncluded) Implemented to be a MenuElement -- does nothing. |
void | paint(Graphics g) Invoked by Swing to draw components. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | remove(int index) Removes the component, specified by index , from this container. |
void | removeAll() Removes all the components from this container. |
void | removeNotify() Overrides JComponent.removeNotify to unregister this menu bar with the current keyboard manager. |
void | revalidate() Supports deferred automatic layout. |
void | setAlignmentX(float alignmentX) Sets the horizontal alignment. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBorderPainted(boolean b) Sets whether the border should be painted. |
void | setBounds(int x, int y, int width, int height) Moves and resizes this component. |
void | setForeground(Color fg) Sets the foreground color of this component. |
void | setHelpMenu(JMenu menu) Sets the help menu that appears when the user selects the "help" option in the menu bar. |
void | setLayout(LayoutManager mgr) Sets the layout manager for this container. |
void | setMargin(Insets m) Sets the margin between the menubar's border and its menus. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setName(String name) Sets the name of the component to the specified string. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setSelected(Component sel) Sets the currently selected component, producing a a change to the selection model. |
void | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setVisible(boolean aFlag) Makes the component visible or invisible. |
void | validate() Validates this container and all of its subcomponents. |