Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JPopupMenu
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JPopupMenu key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
JPopupMenu.AccessibleJPopupMenu
|
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JPopupMenu()
Create a JPopupMenu without an "invoker". |
|
JPopupMenu(java.lang.String label)
Create a JPopupMenu with the specified title. |
Method Summary | |
JMenuItem | add(JMenuItem menuItem)
Appends the specified menu item to the end of this menu. |
java.awt.Component | add(java.awt.Component c)
Appends the specified component to the end of this menu. |
JMenuItem | add(Action a)
Append a new menuitem to the end of the menu which dispatches the specified Action object. |
void | addPopupMenuListener(PopupMenuListener l)
Add a PopupMenu listener param l the PopupMenuListener to add |
void | addSeparator()
|
java.beans.PropertyChangeListener | createActionChangeListener(JMenuItem b)
|
void | firePopupMenuCanceled()
Notifies PopupMenuListeners that this popup menu is canceled |
void | firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that this popup menu will become invisible |
void | firePopupMenuWillBecomeVisible()
Notifies PopupMenuListeners that this popup menu will become visible |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
java.awt.Component | getComponentAtIndex(int i)
Returns the component at the specified index. |
int | getComponentIndex(java.awt.Component c)
Returns the index of the specified component. |
java.awt.Component | getComponent()
|
static boolean | getDefaultLightWeightPopupEnabled()
Return the default value for the lightWeightPopupEnabled property. |
java.awt.Component | getInvoker()
Returns the component which is the 'invoker' of this popup menu. |
java.lang.String | getLabel()
Returns the popup menu's label |
java.awt.Insets | getMargin()
Returns the margin between the popupmenu's border and its containees. return an Insets object containing the margin values. |
SingleSelectionModel | getSelectionModel()
Returns the model object that handles single selections. |
MenuElement[] | getSubElements()
|
java.lang.String | getUIClassID()
Returns the name of the L&F class that renders this component. |
com.sun.java.swing.plaf.PopupMenuUI | getUI()
Returns the L&F object that renders this component. |
void | insert(Action a,
int index)
Inserts a menu item for the specified Action object at a given position. |
void | insert(java.awt.Component component,
int index)
Inserts the specified component into the menu at a given position. |
boolean | isBorderPainted()
Checks whether the border should be painted. |
boolean | isLightWeightPopupEnabled()
Returns true if lightweight (all-Java) popups are in use, or false if heavyweight (native peer) popups are being used. |
boolean | isVisible()
Returns true if the popupmenu is visible (currently being displayed). |
void | menuSelectionChanged(boolean isIncluded)
|
void | pack()
Layout the container so that it uses the minimum space needed to display its contents. |
void | paintBorder(java.awt.Graphics g)
Paint the popup menu's border if BorderPainted property is true. |
void | processKeyEvent(java.awt.event.KeyEvent e,
MenuElement[] path,
MenuSelectionManager manager)
|
void | processMouseEvent(java.awt.event.MouseEvent event,
MenuElement[] path,
MenuSelectionManager manager)
|
void | removePopupMenuListener(PopupMenuListener l)
Remove a PopupMenu listener param l the PopupMenuListener to remove |
void | setBorderPainted(boolean b)
Sets whether the border should be painted. |
static void | setDefaultLightWeightPopupEnabled(boolean aFlag)
Set the default value for the lightWeightPopupEnabled property. |
void | setInvoker(java.awt.Component invoker)
Sets the invoker of this popupmenu -- the component in which the popupmenu menu is to be displayed. |
void | setLabel(java.lang.String label)
Sets the popup menu's label. |
void | setLightWeightPopupEnabled(boolean aFlag)
When displaying the popup, JPopupMenu choose to use a light weight popup if it fits. |
void | setLocation(int x,
int y)
Set the location of the upper left corner of the popup menu using x, y coordinates. |
void | setPopupSize(java.awt.Dimension d)
Sets the size of the Popup window using a Dimension object. |
void | setPopupSize(int width,
int height)
Sets the size of the Popup window to the specified width and height. |
void | setSelected(java.awt.Component sel)
Sets the currently selected component, This will result in a change to the selection model. |
void | setSelectionModel(SingleSelectionModel model)
Set the model object to handle single selections. |
void | setUI(com.sun.java.swing.plaf.PopupMenuUI ui)
Sets the L&F object that renders this component. |
void | setVisible(boolean b)
|
void | show(java.awt.Component invoker,
int x,
int y)
Display the popupmenu at the position x,y in the coordinate space of the component invoker. |
void | updateUI()
Notification from the UIFactory that the L&F has changed. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public JPopupMenu()
public JPopupMenu(java.lang.String label)
label
- The string that a UI may use to display as a title
for the popup menu.Method Detail |
public static void setDefaultLightWeightPopupEnabled(boolean aFlag)
public static boolean getDefaultLightWeightPopupEnabled()
public com.sun.java.swing.plaf.PopupMenuUI getUI()
public void setUI(com.sun.java.swing.plaf.PopupMenuUI ui)
ui
- the new PopupMenuUI L&F objectpublic void updateUI()
public java.lang.String getUIClassID()
public SingleSelectionModel getSelectionModel()
public void setSelectionModel(SingleSelectionModel model)
model
- the SingleSelectionModel to usepublic JMenuItem add(JMenuItem menuItem)
c
- the JMenuItem to addpublic java.awt.Component add(java.awt.Component c)
c
- the Component to addpublic JMenuItem add(Action a)
a
- the Action to add to the menuprotected java.beans.PropertyChangeListener createActionChangeListener(JMenuItem b)
public void setLightWeightPopupEnabled(boolean aFlag)
public boolean isLightWeightPopupEnabled()
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the label for the popup menupublic void addSeparator()
public void insert(Action a, int index)
component
- the Action object to insert
index
- an int specifying the position at which
to insert the Action, where 0 is the firstpublic void insert(java.awt.Component component, int index)
component
- the Component to insert
index
- an int specifying the position at which
to insert the component, where 0 is the firstpublic void addPopupMenuListener(PopupMenuListener l)
public void removePopupMenuListener(PopupMenuListener l)
protected void firePopupMenuWillBecomeVisible()
protected void firePopupMenuWillBecomeInvisible()
protected void firePopupMenuCanceled()
public void pack()
public void setVisible(boolean b)
public boolean isVisible()
public void setLocation(int x, int y)
x
- the x coordinate of the popup's new position
y
- the y coordinate of the popup's new positionpublic java.awt.Component getInvoker()
public void setInvoker(java.awt.Component invoker)
invoker
- the Component in which the popup menu is displayedpublic void show(java.awt.Component invoker, int x, int y)
invoker
- The component in whose space the popupmenu is to appear
x
- the x coordinate in invoker's coordinate space at which
the popup menu is to be displayed
y
- the y coordinate in invoker's coordinate space at which
the popup menu is to be displayedpublic int getComponentIndex(java.awt.Component c)
the
- Component to findpublic java.awt.Component getComponentAtIndex(int i)
i
- the index of the component, where 0 is the firstpublic void setPopupSize(java.awt.Dimension d)
d
- The dimension specifying the new size
of this component.public void setPopupSize(int width, int height)
width
- The new width of the Popup in pixels.
height
- The new height of the Popup in pixels.public void setSelected(java.awt.Component sel)
sel
- the Component to selectpublic boolean isBorderPainted()
public void setBorderPainted(boolean b)
b
- if true, the border is painted.protected void paintBorder(java.awt.Graphics g)
public java.awt.Insets getMargin()
public AccessibleContext getAccessibleContext()
public void processMouseEvent(java.awt.event.MouseEvent event, MenuElement[] path, MenuSelectionManager manager)
public void processKeyEvent(java.awt.event.KeyEvent e, MenuElement[] path, MenuSelectionManager manager)
public void menuSelectionChanged(boolean isIncluded)
public MenuElement[] getSubElements()
public java.awt.Component getComponent()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |