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, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。