All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JMenu
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.AbstractButton
|
+----com.sun.java.swing.JMenuItem
|
+----com.sun.java.swing.JMenu
- public class JMenu
- extends JMenuItem
An implementation of a Menu
-
menuChangeListener
- The button's model listeners.
-
menuEvent
- Only one MenuEvent is needed per menu instance since the
event's only state is the source property.
-
menuListenerList
- The lists of client listeners.
-
popupListener
-
-
ui
-
-
JMenu()
-
-
JMenu(String)
-
-
JMenu(String, boolean)
-
-
add(Action)
-
-
add(Component)
-
-
add(JMenuItem)
-
-
add(String)
-
-
addMenuListener(MenuListener)
-
-
addSeparator()
-
-
createMenuChangeListener()
-
-
createWinListener(JPopupMenu)
-
-
getComponent(int)
-
-
getComponentAt(int, int)
-
-
getComponentCount()
-
-
getComponents()
-
-
getItem(int)
-
-
getItemCount()
-
-
getPopupMenu()
-
-
getTranslatedPoint(int, int, Component, Component)
- Returns the given point in the from components coordinate
space translated into the to components coordinate space.
-
insert(Action, int)
-
-
insert(JMenuItem, int)
-
-
insert(String, int)
-
-
insertSeparator(int)
-
-
isLabelShown()
-
-
isPopupMenuVisible()
-
-
isSelected()
- Returns the state of the button.
-
isSubComponent(Component)
- Returns true if the component c exists in the submenu hierarchy.
-
isTearOff()
-
-
isTopLevelMenu()
-
-
paramString()
-
-
remove(Action)
-
-
remove(int)
-
-
remove(JMenuItem)
-
-
removeAll()
-
-
removeMenuListener(MenuListener)
-
-
setLabelShown(boolean)
-
-
setLocation(int, int)
-
-
setModel(ButtonModel)
- Set the model that this button represents.
-
setPopupMenuVisible(boolean)
-
-
setSelected(boolean)
- Sets the state of the button.
-
setUI(MenuUI)
- Sets the menu's UI.
-
translateToPopupMenu(int, int)
- Returns a point in the coordinate space of this menu's popupmenu
which corresponds to the point (x,y) in the menu's coordinate space.
-
translateToPopupMenu(Point)
- Returns a point in the coordinate space of this menu's popupmenu
which corresponds to the point p in the menu's coordinate space.
-
updateUI()
- Gets a new UI object from the default UIFactory.
ui
protected MenuUI ui
popupListener
protected JMenu. WinListener popupListener
menuChangeListener
protected ChangeListener menuChangeListener
- The button's model listeners.
menuListenerList
protected MenuListener menuListenerList
- The lists of client listeners.
menuEvent
protected MenuEvent menuEvent
- Only one MenuEvent is needed per menu instance since the
event's only state is the source property. The source of events
generated is always "this".
JMenu
public JMenu()
JMenu
public JMenu(String s)
JMenu
public JMenu(String s,
boolean b)
setUI
public void setUI(MenuUI ui)
- Sets the menu's UI.
- Parameters:
- ui - the new MenuUI
- See Also:
- getUI
updateUI
public void updateUI()
- Gets a new UI object from the default UIFactory.
- Overrides:
- updateUI in class JMenuItem
setModel
public void setModel(ButtonModel newModel)
- Set the model that this button represents.
- Parameters:
- m - the Model
- Overrides:
- setModel in class AbstractButton
- See Also:
- getModel
isSelected
public boolean isSelected()
- Returns the state of the button.
- Overrides:
- isSelected in class AbstractButton
setSelected
public void setSelected(boolean b)
- Sets the state of the button.
- Overrides:
- setSelected in class AbstractButton
isPopupMenuVisible
public boolean isPopupMenuVisible()
setPopupMenuVisible
public void setPopupMenuVisible(boolean b)
setLocation
public void setLocation(int x,
int y)
- Overrides:
- setLocation in class Component
add
public JMenuItem add(JMenuItem menuItem)
add
public Component add(Component c)
- Overrides:
- add in class Container
add
public void add(String s)
add
public JMenuItem add(Action a)
addSeparator
public void addSeparator()
insert
public void insert(String s,
int pos)
insert
public JMenuItem insert(JMenuItem mi,
int pos)
insert
public void insert(Action a,
int pos)
insertSeparator
public JMenuItem insertSeparator(int pos)
getItem
public JMenuItem getItem(int pos)
getItemCount
public int getItemCount()
isTearOff
public boolean isTearOff()
remove
public void remove(JMenuItem mi)
remove
public void remove(Action a)
remove
public void remove(int pos)
- Overrides:
- remove in class Container
removeAll
public void removeAll()
- Overrides:
- removeAll in class Container
getComponentCount
public int getComponentCount()
- Overrides:
- getComponentCount in class Container
getComponent
public Component getComponent(int n)
- Overrides:
- getComponent in class Container
getComponents
public Component[] getComponents()
- Overrides:
- getComponents in class Container
paramString
protected String paramString()
- Overrides:
- paramString in class Container
setLabelShown
public void setLabelShown(boolean b)
isLabelShown
public boolean isLabelShown()
isTopLevelMenu
public boolean isTopLevelMenu()
getComponentAt
public Component getComponentAt(int x,
int y)
- Overrides:
- getComponentAt in class Container
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.
isSubComponent
public boolean isSubComponent(Component c)
- Returns true if the component c exists in the submenu hierarchy.
- Parameters:
- c - the component to be tested
translateToPopupMenu
public Point translateToPopupMenu(Point p)
- Returns a point in the coordinate space of this menu's popupmenu
which corresponds to the point p in the menu's coordinate space.
- Parameters:
- p - the point to be translated
translateToPopupMenu
public Point translateToPopupMenu(int x,
int y)
- Returns a point in the coordinate space of this menu's popupmenu
which corresponds to the point (x,y) in the menu's coordinate space.
- Parameters:
- x - the x coordinate of the point to be translated
- y - the y coordinate of the point to be translated
getPopupMenu
public JPopupMenu getPopupMenu()
addMenuListener
public void addMenuListener(MenuListener l)
removeMenuListener
public void removeMenuListener(MenuListener l)
createMenuChangeListener
protected ChangeListener createMenuChangeListener()
createWinListener
protected JMenu. WinListener createWinListener(JPopupMenu p)
All Packages Class Hierarchy This Package Previous Next Index