public class PopupMenu extends Menu
継承階層が示すように、PopupMenu は Menu が使用できる場所であればどこでも使用できます。 ただし、MenuBar に追加するなど PopupMenu を Menu のように使用する場合は、その PopupMenu に show を呼び出すことはできません。
| 修飾子と型 | クラスと説明 |
|---|---|
protected class |
PopupMenu.AccessibleAWTPopupMenu
アクセシビリティーのデフォルトサポートを提供するために使用される PopupMenu の内部クラスです。
|
Menu.AccessibleAWTMenuMenuItem.AccessibleAWTMenuItemMenuComponent.AccessibleAWTMenuComponent| コンストラクタと説明 |
|---|
PopupMenu()
新しいポップアップメニューを、空の名前で作成します。
|
PopupMenu(String label)
新しいポップアップメニューを、指定された名前で作成します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
void |
addNotify()
ポップアップメニューのピアを作成します。
|
AccessibleContext |
getAccessibleContext()
この
PopupMenu に関連付けられている AccessibleContext を取得します。 |
MenuContainer |
getParent()
このメニューコンポーネントの親コンテナを返します。
|
void |
show(Component origin, int x, int y)
元のコンポーネントからの相対位置 x, y にポップアップメニューを表示します。
|
add, add, addSeparator, countItems, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotifyaddActionListener, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcutdispatchEvent, getFont, getName, getPeer, getTreeLock, postEvent, setFont, setName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFont, postEventpublic PopupMenu()
throws HeadlessException
HeadlessException - GraphicsEnvironment.isHeadless() が true を返した場合。GraphicsEnvironment.isHeadless()public PopupMenu(String label) throws HeadlessException
label - ポップアップメニューのラベルを指定する null 以外の文字列HeadlessException - GraphicsEnvironment.isHeadless() が true を返した場合。GraphicsEnvironment.isHeadless()public MenuContainer getParent()
getParent、クラス: MenuComponentnullpublic void addNotify()
public void show(Component origin, int x, int y)
この PopupMenu が Menu として使用されている場合、つまり Component ではない親を持つ場合、その PopupMenu でこのメソッドを呼び出すことはできません。
origin - 座標空間を定義するコンポーネントx - メニューをポップアップする x 座標y - メニューをポップアップする y 座標NullPointerException - 親が null の場合IllegalArgumentException - この PopupMenu が Component ではない親を持つ場合IllegalArgumentException - 原点が親の階層にない場合RuntimeException - 親が画面に表示されていない場合public AccessibleContext getAccessibleContext()
PopupMenu に関連付けられている AccessibleContext を取得します。getAccessibleContext、インタフェース: AccessiblegetAccessibleContext、クラス: MenuPopupMenu の AccessibleContext バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.