- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JPopupMenu
 
 
 
 
- 
- すべての実装されたインタフェース:
- ImageObserver,- MenuContainer,- Serializable,- Accessible,- MenuElement
 - 直系の既知のサブクラス:
- BasicComboPopup
 
 @JavaBean(defaultProperty="UI", description="A small window that pops up and displays a series of choices.") public class JPopupMenu extends JComponent implements Accessible, MenuElement ポップアップ・メニュー(一連の選択肢をポップアップおよび表示する小さなウィンドウ)の実装です。JPopupMenuは、メニュー・バー上の項目が選択されたときに表示するメニューに使用します。 これは、プルライト・メニューにも使用されます。プルライト・メニューは、これをアクティブにするメニュー項目をユーザーが選択したときに表示されます。 あるいは、メニューを表示するほかの場所(メニュー・バー以外の場所)でも、JPopupMenuを使用できます。 たとえば、特定の場所で右クリックが発生した場合のポップアップ・メニュー表示(ショートカット・メニュー)などです。ポップアップ・メニューの使用方法の詳細と例については、「The Java Tutorial」の「How to Use Menus」を参照してください。 警告: Swingはスレッドに対して安全ではありません。 詳細は、「Swing's Threading Policy」を参照してください。 警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが java.beansパッケージに追加されています。XMLEncoderを参照してください。- 導入されたバージョン:
- 1.2
- 関連項目:
- 直列化された形式
 
- 
- 
ネストされたクラスのサマリーネストされたクラス 修飾子と型 クラス 説明 protected classJPopupMenu.AccessibleJPopupMenuこのクラスはJPopupMenuクラスのアクセシビリティ・サポートを実装しています。static classJPopupMenu.Separatorポップアップ・メニュー固有のセパレータです。- 
クラス javax.swing.JComponentで宣言されたネストされたクラス/インタフェースJComponent.AccessibleJComponent
 - 
クラス java.awt.Containerで宣言されたネストされたクラス/インタフェースContainer.AccessibleAWTContainer
 - 
クラス java.awt.Componentで宣言されたネストされたクラス/インタフェースComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
- 
 - 
フィールドのサマリー- 
クラス javax.swing.JComponentで宣言されたフィールドlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 - 
クラス java.awt.Componentで宣言されたフィールドaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 - 
インタフェース java.awt.image.ImageObserverで宣言されたフィールドABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
- 
 - 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 JPopupMenu()呼出しコンポーネントの定義なしでJPopupMenuを構築します。JPopupMenu(String label)指定されたタイトルを使用してJPopupMenuを構築します。
 - 
メソッドのサマリーすべてのメソッド staticメソッド インスタンス・メソッド 具象メソッド 非推奨のメソッド 修飾子と型 メソッド 説明 JMenuItemadd(String s)指定されたテキストを持つ新しいメニュー項目を作成して、このメニューの末尾に追加します。JMenuItemadd(Action a)メニューの末尾に、指定されたActionオブジェクトをディスパッチするメニュー項目を追加します。JMenuItemadd(JMenuItem menuItem)指定されたメニュー項目をメニューの末尾に追加します。voidaddMenuKeyListener(MenuKeyListener l)ポップアップ・メニューにMenuKeyListenerを追加します。voidaddPopupMenuListener(PopupMenuListener l)PopupMenuリスナーを追加します。voidaddSeparator()メニューの末尾に新しいセパレータを追加します。protected PropertyChangeListenercreateActionChangeListener(JMenuItem b)Actionに対する変更が発生した場合にコントロールを更新する、適切に構成されたPropertyChangeListenerを返します。protected JMenuItemcreateActionComponent(Action a)JPopupMenuに追加されるActionsのJMenuItemを作成するファクトリ・メソッドです。protected voidfirePopupMenuCanceled()PopupMenuListenersに、このポップアップ・メニューが取り消されたことを通知します。protected voidfirePopupMenuWillBecomeInvisible()PopupMenuListenerに、このポップアップ・メニューが不可視になることを通知します。protected voidfirePopupMenuWillBecomeVisible()PopupMenuListenerに、このポップアップ・メニューが可視になることを通知します。AccessibleContextgetAccessibleContext()このJPopupMenuに関連付けられたAccessibleContextを取得します。ComponentgetComponent()このJPopupMenuコンポーネントを返します。ComponentgetComponentAtIndex(int i)非推奨。Container.getComponent(int)に置き換えられますintgetComponentIndex(Component c)指定されたコンポーネントのインデックスを返します。static booleangetDefaultLightWeightPopupEnabled()defaultLightWeightPopupEnabledプロパティを取得します。デフォルトではtrueです。ComponentgetInvoker()このポップアップ・メニューの呼出し側であるコンポーネントを返します。StringgetLabel()ポップアップ・メニューのラベルを返します。InsetsgetMargin()ポップアップ・メニューのボーダーとコンテナの間にあるマージンを返します(ピクセル単位)。MenuKeyListener[]getMenuKeyListeners()addMenuKeyListener()を使用してこのJPopupMenuに追加されたすべてのMenuKeyListenerの配列を返します。PopupMenuListener[]getPopupMenuListeners()addPopupMenuListener()を使用してこのJMenuItemに追加されたすべてのPopupMenuListenerの配列を返します。SingleSelectionModelgetSelectionModel()単一の選択を扱うモデル・オブジェクトを返します。MenuElement[]getSubElements()このメニュー・コンポーネントのサブメニューを格納するMenuElementの配列を返します。PopupMenuUIgetUI()このコンポーネントを描画するルック・アンド・フィール (L&F)オブジェクトを返します。StringgetUIClassID()このコンポーネントをレンダリングするL&Fクラスの名前を返します。voidinsert(Component component, int index)指定されたコンポーネントを、メニューの指定された位置に挿入します。voidinsert(Action a, int index)指定されたActionオブジェクトを、メニュー項目として指定の位置に挿入します。booleanisBorderPainted()ボーダーをペイントするかどうかを調べます。booleanisLightWeightPopupEnabled()lightWeightPopupEnabledプロパティを取得します。booleanisPopupTrigger(MouseEvent e)JPopupMenuの現在インストールされているUIがMouseEventをポップアップ・トリガーと見なす場合は、trueを返します。booleanisVisible()ポップアップ・メニューが可視(現在表示中)である場合にtrueを返します。voidmenuSelectionChanged(boolean isIncluded)このメニューをアクティブにするか、アクティブではなくするためにメニュー・バーの選択が変更されたときに、メッセージを送ります。voidpack()コンテナをレイアウトして、内容の表示に最小限の空間を使用するようにします。protected voidpaintBorder(Graphics g)borderPaintedプロパティがtrueである場合に、ポップアップ・メニューのボーダーをペイントします。protected StringparamString()このJPopupMenuの文字列表現を返します。protected voidprocessKeyEvent(KeyEvent evt)ニーモニックやアクセラレータなどの、キー・ストローク・イベントを処理します。voidprocessKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager manager)MenuSelectionManagerから転送されるキー・イベントを処理し、必要に応じてMenuSelectionManagerのAPIを使用して、メニュー選択を変更します。voidprocessMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager)このメソッドはMenuElementインタフェースに適合するために必要ですが、実装されていません。voidremove(int pos)指定されたインデックスにあるコンポーネントをこのポップアップ・メニューから削除します。voidremoveMenuKeyListener(MenuKeyListener l)ポップアップ・メニューからMenuKeyListenerを削除します。voidremovePopupMenuListener(PopupMenuListener l)PopupMenuリスナーを削除します。voidsetBorderPainted(boolean b)ボーダーをペイントするかどうかを設定します。static voidsetDefaultLightWeightPopupEnabled(boolean aFlag)lightWeightPopupEnabledプロパティのデフォルト値を設定します。voidsetInvoker(Component invoker)ポップアップ・メニューの呼出し側、すなわち、ポップアップ・メニュー項目が表示されるコンポーネントを設定します。voidsetLabel(String label)ポップアップ・メニューのラベルを設定します。voidsetLightWeightPopupEnabled(boolean aFlag)lightWeightPopupEnabledプロパティの値を設定します。デフォルトではtrueです。voidsetLocation(int x, int y)x、y座標を使って、ポップアップ・メニューの左上隅の位置を設定します。voidsetPopupSize(int width, int height)ポップアップ・ウィンドウのサイズを、指定された幅および高さに設定します。voidsetPopupSize(Dimension d)Dimensionオブジェクトを使用して、Popupウィンドウのサイズを設定します。voidsetSelected(Component sel)現在選択されるコンポーネントを設定します。結果として、選択モデルが変更されます。voidsetSelectionModel(SingleSelectionModel model)単一の選択を扱うモデル・オブジェクトを設定します。voidsetUI(PopupMenuUI ui)このコンポーネントをレンダリングするL&Fオブジェクトを設定します。voidsetVisible(boolean b)ポップアップ・メニューの可視性を設定します。voidshow(Component invoker, int x, int y)呼出しコンポーネント内のx、y座標で指定された位置に、ポップアップ・メニューを表示します。voidupdateUI()現在のルック・アンド・フィールからの値にUIプロパティをリセットします。- 
クラス javax.swing.JComponentで宣言されたメソッドaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 - 
クラス java.awt.Containerで宣言されたメソッドadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
クラス java.awt.Componentで宣言されたメソッドaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
コンストラクタの詳細- 
JPopupMenupublic JPopupMenu() 呼出しコンポーネントの定義なしでJPopupMenuを構築します。
 - 
JPopupMenupublic JPopupMenu(String label) 指定されたタイトルを使用してJPopupMenuを構築します。- パラメータ:
- label- ポップアップ・メニューのタイトルとしてUIが使用できる文字列。
 
 
- 
 - 
メソッドの詳細- 
setDefaultLightWeightPopupEnabledpublic static void setDefaultLightWeightPopupEnabled(boolean aFlag) lightWeightPopupEnabledプロパティのデフォルト値を設定します。- パラメータ:
- aFlag- ポップアップが軽量の場合は- true、そうでない場合は- false
- 関連項目:
- getDefaultLightWeightPopupEnabled(),- setLightWeightPopupEnabled(boolean)
 
 - 
getDefaultLightWeightPopupEnabledpublic static boolean getDefaultLightWeightPopupEnabled() defaultLightWeightPopupEnabledプロパティを取得します。デフォルトではtrueです。- 戻り値:
- defaultLightWeightPopupEnabledプロパティの値
- 関連項目:
- setDefaultLightWeightPopupEnabled(boolean)
 
 - 
getUIpublic PopupMenuUI getUI() このコンポーネントを描画するルック・アンド・フィール (L&F)オブジェクトを返します。- オーバーライド:
- クラスJComponentのgetUI
- 戻り値:
- このコンポーネントをレンダリングするPopupMenuUIオブジェクト
 
 - 
setUI@BeanProperty(hidden=true, visualUpdate=true, description="The UI object that implements the Component\'s LookAndFeel.") public void setUI(PopupMenuUI ui) このコンポーネントをレンダリングするL&Fオブジェクトを設定します。- パラメータ:
- ui- 新規- PopupMenuUIL&Fオブジェクト
- 関連項目:
- UIDefaults.getUI(javax.swing.JComponent)
 
 - 
updateUIpublic void updateUI() 現在のルック・アンド・フィールからの値にUIプロパティをリセットします。- オーバーライド:
- updateUI、クラス- JComponent
- 関連項目:
- JComponent.updateUI()
 
 - 
getUIClassID@BeanProperty(bound=false) public String getUIClassID() このコンポーネントをレンダリングするL&Fクラスの名前を返します。- オーバーライド:
- getUIClassID、クラス- JComponent
- 戻り値:
- 文字列「PopupMenuUI」
- 関連項目:
- JComponent.getUIClassID(),- UIDefaults.getUI(javax.swing.JComponent)
 
 - 
processKeyEventprotected void processKeyEvent(KeyEvent evt) ニーモニックやアクセラレータなどの、キー・ストローク・イベントを処理します。- オーバーライド:
- processKeyEvent、クラス- JComponent
- パラメータ:
- evt- 処理されるキー・イベント
- 関連項目:
- KeyEvent,- KeyListener,- KeyboardFocusManager,- DefaultKeyboardFocusManager,- Component.processEvent(java.awt.AWTEvent),- Component.dispatchEvent(java.awt.AWTEvent),- Component.addKeyListener(java.awt.event.KeyListener),- Component.enableEvents(long),- Component.isShowing()
 
 - 
getSelectionModelpublic SingleSelectionModel getSelectionModel() 単一の選択を扱うモデル・オブジェクトを返します。- 戻り値:
- selectionModelプロパティ
- 関連項目:
- SingleSelectionModel
 
 - 
setSelectionModel@BeanProperty(bound=false, expert=true, description="The selection model for the popup menu") public void setSelectionModel(SingleSelectionModel model) 単一の選択を扱うモデル・オブジェクトを設定します。- パラメータ:
- model- 新しい- SingleSelectionModel
- 関連項目:
- SingleSelectionModel
 
 - 
addpublic JMenuItem add(JMenuItem menuItem) 指定されたメニュー項目をメニューの末尾に追加します。- パラメータ:
- menuItem- 追加する- JMenuItem
- 戻り値:
- 追加されたJMenuItem
 
 - 
addpublic JMenuItem add(String s) 指定されたテキストを持つ新しいメニュー項目を作成して、このメニューの末尾に追加します。- パラメータ:
- s- 追加されるメニュー項目の文字列
- 戻り値:
- sを使用して作成された新しい- JMenuItem
 
 - 
addpublic JMenuItem add(Action a) メニューの末尾に、指定されたActionオブジェクトをディスパッチするメニュー項目を追加します。- パラメータ:
- a- メニューに追加する- Action
- 戻り値:
- 新しいメニュー項目
- 関連項目:
- Action
 
 - 
createActionComponentprotected JMenuItem createActionComponent(Action a) JPopupMenuに追加されるActionsのJMenuItemを作成するファクトリ・メソッドです。- パラメータ:
- a- 追加されるメニュー項目の- Action
- 戻り値:
- 新しいメニュー項目
- 導入されたバージョン:
- 1.3
- 関連項目:
- Action
 
 - 
createActionChangeListenerprotected PropertyChangeListener createActionChangeListener(JMenuItem b) Actionに対する変更が発生した場合にコントロールを更新する、適切に構成されたPropertyChangeListenerを返します。- パラメータ:
- b- リスナーを作成するメニュー・アイテム
- 戻り値:
- 適切に構成されたPropertyChangeListener
 
 - 
removepublic void remove(int pos) 指定されたインデックスにあるコンポーネントをこのポップアップ・メニューから削除します。- オーバーライド:
- remove、クラス- Container
- パラメータ:
- pos- 削除される項目の位置
- 例外:
- IllegalArgumentException-- posの値が0より小さいか、- posの値がメニュー項目の数より大きい場合
- 関連項目:
- Container.add(java.awt.Component),- Container.invalidate(),- Container.validate(),- Container.getComponentCount()
 
 - 
setLightWeightPopupEnabled@BeanProperty(bound=false, expert=true, description="Determines whether lightweight popups are used when possible") public void setLightWeightPopupEnabled(boolean aFlag) lightWeightPopupEnabledプロパティの値を設定します。デフォルトではtrueです。 ルック・アンド・フィールがポップアップを表示するとき、デフォルトでは軽量(Java共通言語)ポップアップの使用を選択できます。 軽量ポップアップ・ウィンドウは重量(ネイティブ・ピア)ウィンドウよりも効率的ですが、軽量コンポーネントと重量コンポーネントはGUI内でうまく混在しません。 アプリケーションで軽量コンポーネントと重量コンポーネントが混在している場合は、軽量ポップアップを無効にする必要があります。 一部のルック・アンド・フィールでは、このプロパティの値に関係なく常に重量ポップアップが使用されることがあります。- パラメータ:
- aFlag- 軽量ポップアップを無効にする場合は- false
- 関連項目:
- isLightWeightPopupEnabled()
 
 - 
isLightWeightPopupEnabledpublic boolean isLightWeightPopupEnabled() lightWeightPopupEnabledプロパティを取得します。- 戻り値:
- lightWeightPopupEnabledプロパティの値
- 関連項目:
- setLightWeightPopupEnabled(boolean)
 
 - 
getLabelpublic String getLabel() ポップアップ・メニューのラベルを返します。- 戻り値:
- ポップアップ・メニューのラベルが格納されている文字列
- 関連項目:
- setLabel(java.lang.String)
 
 - 
setLabel@BeanProperty(description="The label for the popup menu.") public void setLabel(String label) ポップアップ・メニューのラベルを設定します。 ルック・アンド・フィールの実装ごとに、ラベルを表示するかどうかを選択してもかまいません。- パラメータ:
- label- ポップアップ・メニューのラベルを指定する文字列
- 関連項目:
- setLabel(java.lang.String)
 
 - 
addSeparatorpublic void addSeparator() メニューの末尾に新しいセパレータを追加します。
 - 
insertpublic void insert(Action a, int index) 指定されたActionオブジェクトを、メニュー項目として指定の位置に挿入します。- パラメータ:
- a- 挿入する- Actionオブジェクト
- index-- Actionを挿入する位置。0はメニューの先頭
- 例外:
- IllegalArgumentException-- indexが0未満の場合
- 関連項目:
- Action
 
 - 
insertpublic void insert(Component component, int index) 指定されたコンポーネントを、メニューの指定された位置に挿入します。- パラメータ:
- component- 挿入する- Component
- index- コンポーネントを挿入する位置。0はメニューの先頭
- 例外:
- IllegalArgumentException-- indexが0未満の場合
 
 - 
addPopupMenuListenerpublic void addPopupMenuListener(PopupMenuListener l) PopupMenuリスナーを追加します。- パラメータ:
- l- 追加する- PopupMenuListener
 
 - 
removePopupMenuListenerpublic void removePopupMenuListener(PopupMenuListener l) PopupMenuリスナーを削除します。- パラメータ:
- l- 削除する- PopupMenuListener
 
 - 
getPopupMenuListeners@BeanProperty(bound=false) public PopupMenuListener[] getPopupMenuListeners() addPopupMenuListener()を使用してこのJMenuItemに追加されたすべてのPopupMenuListenerの配列を返します。- 戻り値:
- 追加されたすべてのPopupMenuListener。リスナーが追加されていない場合は空の配列
- 導入されたバージョン:
- 1.4
 
 - 
addMenuKeyListenerpublic void addMenuKeyListener(MenuKeyListener l) ポップアップ・メニューにMenuKeyListenerを追加します。- パラメータ:
- l- 追加される- MenuKeyListener
- 導入されたバージョン:
- 1.5
 
 - 
removeMenuKeyListenerpublic void removeMenuKeyListener(MenuKeyListener l) ポップアップ・メニューからMenuKeyListenerを削除します。- パラメータ:
- l- 削除する- MenuKeyListener
- 導入されたバージョン:
- 1.5
 
 - 
getMenuKeyListeners@BeanProperty(bound=false) public MenuKeyListener[] getMenuKeyListeners() addMenuKeyListener()を使用してこのJPopupMenuに追加されたすべてのMenuKeyListenerの配列を返します。- 戻り値:
- 追加されたすべてのMenuKeyListener。リスナーが追加されていない場合は空の配列
- 導入されたバージョン:
- 1.5
 
 - 
firePopupMenuWillBecomeVisibleprotected void firePopupMenuWillBecomeVisible() PopupMenuListenerに、このポップアップ・メニューが可視になることを通知します。
 - 
firePopupMenuWillBecomeInvisibleprotected void firePopupMenuWillBecomeInvisible() PopupMenuListenerに、このポップアップ・メニューが不可視になることを通知します。
 - 
firePopupMenuCanceledprotected void firePopupMenuCanceled() PopupMenuListenersに、このポップアップ・メニューが取り消されたことを通知します。
 - 
packpublic void pack() コンテナをレイアウトして、内容の表示に最小限の空間を使用するようにします。
 - 
setVisible@BeanProperty(description="Makes the popup visible") public void setVisible(boolean b) ポップアップ・メニューの可視性を設定します。- オーバーライド:
- setVisible、クラス- JComponent
- パラメータ:
- b- ポップアップを可視にする場合はtrue、隠す場合はfalse
- 関連項目:
- Component.isVisible(),- Component.invalidate()
 
 - 
isVisiblepublic boolean isVisible() ポップアップ・メニューが可視(現在表示中)である場合にtrueを返します。- オーバーライド:
- isVisible、クラス- Component
- 戻り値:
- コンポーネントが可視の場合はtrue、そうでない場合はfalse
- 関連項目:
- Component.setVisible(boolean)
 
 - 
setLocation@BeanProperty(description="The location of the popup menu.") public void setLocation(int x, int y) x、y座標を使って、ポップアップ・メニューの左上隅の位置を設定します。このメソッドは、幾何学的図形に関連するデータを変更します。 そのため、 JPopupMenuオブジェクトがデスクトップ設定に厳密に対応する方法で配置およびサイズ設定されるように、ネイティブ・ウィンドウ管理システムはこのような要求を無視するか、または要求されたデータを変更する可能性があります。- オーバーライド:
- setLocation、クラス- Component
- パラメータ:
- x- 画面の座標空間でのポップアップ・メニューの新しい位置のx座標
- y- 画面の座標空間でのポップアップ・メニューの新しい位置のy座標
- 関連項目:
- Component.getLocation(),- Component.setBounds(int, int, int, int),- Component.invalidate()
 
 - 
getInvokerpublic Component getInvoker() このポップアップ・メニューの呼出し側であるコンポーネントを返します。- 戻り値:
- ポップアップ・メニューが表示されるComponent
 
 - 
setInvoker@BeanProperty(bound=false, expert=true, description="The invoking component for the popup menu") public void setInvoker(Component invoker) ポップアップ・メニューの呼出し側、すなわち、ポップアップ・メニュー項目が表示されるコンポーネントを設定します。- パラメータ:
- invoker- ポップアップ・メニューが表示される- Component
 
 - 
showpublic void show(Component invoker, int x, int y) 呼出しコンポーネント内のx、y座標で指定された位置に、ポップアップ・メニューを表示します。- パラメータ:
- invoker- ポップアップ・メニューが表示されるコンポーネント
- x- ポップアップ・メニューを表示する呼出しコンポーネントの座標空間でのx座標
- y- ポップアップ・メニューを表示する呼出しコンポーネントの座標空間でのy座標
 
 - 
getComponentAtIndex@Deprecated public Component getComponentAtIndex(int i) 非推奨。Container.getComponent(int)に置き換えられます指定されたインデックスの要素を返します。- パラメータ:
- i- コンポーネントのインデックス。0が先頭
- 戻り値:
- 指定されたインデックスのComponent
 
 - 
getComponentIndexpublic int getComponentIndex(Component c) 指定されたコンポーネントのインデックスを返します。- パラメータ:
- c- 検索対象の- Component
- 戻り値:
- コンポーネントのインデックス。0が先頭。コンポーネントがなければ -1
 
 - 
setPopupSize@BeanProperty(description="The size of the popup menu") public void setPopupSize(Dimension d) Dimensionオブジェクトを使用して、Popupウィンドウのサイズを設定します。 これは、setPreferredSize(d)と同等です。- パラメータ:
- d- このコンポーネントの新規サイズを指定する- Dimension。
 
 - 
setPopupSize@BeanProperty(description="The size of the popup menu") public void setPopupSize(int width, int height) ポップアップ・ウィンドウのサイズを、指定された幅および高さに設定します。 これは、setPreferredSize(new Dimension(width, height))と同等です。- パラメータ:
- width- Popupの新しい幅(ピクセル単位)
- height- Popupの新しい高さ(ピクセル単位)
 
 - 
setSelected@BeanProperty(expert=true, hidden=true, description="The selected component on the popup menu") public void setSelected(Component sel) 現在選択されるコンポーネントを設定します。結果として、選択モデルが変更されます。- パラメータ:
- sel- 選択する- Component
 
 - 
isBorderPaintedpublic boolean isBorderPainted() ボーダーをペイントするかどうかを調べます。- 戻り値:
- ボーダーをペイントする場合はtrue、そうでない場合はfalse
- 関連項目:
- setBorderPainted(boolean)
 
 - 
setBorderPainted@BeanProperty(bound=false, description="Is the border of the popup menu painted") public void setBorderPainted(boolean b) ボーダーをペイントするかどうかを設定します。- パラメータ:
- b- trueの場合はボーダーがペイントされる。
- 関連項目:
- isBorderPainted()
 
 - 
paintBorderprotected void paintBorder(Graphics g) borderPaintedプロパティがtrueである場合に、ポップアップ・メニューのボーダーをペイントします。- オーバーライド:
- paintBorder、クラス- JComponent
- パラメータ:
- g-- Graphicsオブジェクト
- 関連項目:
- JComponent.paint(java.awt.Graphics),- JComponent.setBorder(javax.swing.border.Border)
 
 - 
getMargin@BeanProperty(bound=false) public Insets getMargin() ポップアップ・メニューのボーダーとコンテナの間にあるマージンを返します(ピクセル単位)。- 戻り値:
- マージン値を保持するInsetsオブジェクト。
 
 - 
paramStringprotected String paramString() このJPopupMenuの文字列表現を返します。 このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なる可能性があります。 返される文字列は空でもかまいませんが、nullにはできません。- オーバーライド:
- paramString、クラス- JComponent
- 戻り値:
- このJPopupMenuを表す文字列表現。
 
 - 
getAccessibleContext@BeanProperty(bound=false) public AccessibleContext getAccessibleContext() このJPopupMenuに関連付けられたAccessibleContextを取得します。 JPopupMenuの場合、AccessibleContextはAccessibleJPopupMenuの形式を取ります。 必要に応じて新規のAccessibleJPopupMenuインスタンスが作成されます。- 定義:
- getAccessibleContext、インタフェース- Accessible
- オーバーライド:
- getAccessibleContext、クラス- Component
- 戻り値:
- このJPopupMenuのAccessibleContextとして機能するAccessibleJPopupMenu
 
 - 
processMouseEventpublic void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager) このメソッドはMenuElementインタフェースに適合するために必要ですが、実装されていません。- 定義:
- processMouseEvent、インタフェース- MenuElement
- パラメータ:
- event- 処理される- MouseEvent
- path- メニュー階層内の受信要素のパス
- manager- メニュー階層の- MenuSelectionManager
- 関連項目:
- MenuElement.processMouseEvent(MouseEvent, MenuElement[], MenuSelectionManager)
 
 - 
processKeyEventpublic void processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager manager) MenuSelectionManagerから転送されるキー・イベントを処理し、必要に応じてMenuSelectionManagerのAPIを使用して、メニュー選択を変更します。ノート: イベントをサブコンポーネントに転送する必要はありません。 MenuSelectionManagerが自動的に行います。- 定義:
- processKeyEvent、インタフェース- MenuElement
- パラメータ:
- e- a- KeyEvent
- path-- MenuElementパス配列
- manager-- MenuSelectionManager
 
 - 
menuSelectionChangedpublic void menuSelectionChanged(boolean isIncluded) このメニューをアクティブにするか、アクティブではなくするためにメニュー・バーの選択が変更されたときに、メッセージを送ります。 これはjavax.swing.MenuElementインタフェースを実装します。MenuElement.menuSelectionChangedをオーバーライドします。- 定義:
- menuSelectionChanged、インタフェース- MenuElement
- パラメータ:
- isIncluded- このメニューがアクティブな場合はtrue、そうでない場合はfalse
- 関連項目:
- MenuElement.menuSelectionChanged(boolean)
 
 - 
getSubElements@BeanProperty(bound=false) public MenuElement[] getSubElements() このメニュー・コンポーネントのサブメニューを格納するMenuElementの配列を返します。JMenuElementインタフェースに適合する項目だけを返します。 ポップアップ・メニューがnullの場合は空の配列を返します。 このメソッドは、MenuElementインタフェースに適合するために必要です。- 定義:
- getSubElements、インタフェース- MenuElement
- 戻り値:
- MenuElementオブジェクトの配列
- 関連項目:
- MenuElement.getSubElements()
 
 - 
getComponentpublic Component getComponent() このJPopupMenuコンポーネントを返します。- 定義:
- getComponent、インタフェース- MenuElement
- 戻り値:
- このJPopupMenuオブジェクト
- 関連項目:
- MenuElement.getComponent()
 
 - 
isPopupTriggerpublic boolean isPopupTrigger(MouseEvent e) JPopupMenuの現在インストールされているUIがMouseEventをポップアップ・トリガーと見なす場合は、trueを返します。- パラメータ:
- e- a- MouseEvent
- 戻り値:
- マウス・イベントがポップアップ・トリガーの場合はtrue
- 導入されたバージョン:
- 1.3
 
 
- 
 
-