|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.MenuComponent
java.awt.MenuItem
java.awt.Menu
java.awt.PopupMenu
public class PopupMenu
此類別實作能夠在元件中的指定位置上動態彈出的選單。
正如繼承層次關係所暗示的那樣,任何可以使用 Menu 的地方都可以使用 PopupMenu。但是,如果使用像 Menu 這樣的 PopupMenu(例如,將其添加到 MenuBar),則不能調用該 PopupMenu 的 show。
| 巢狀類別摘要 | |
|---|---|
protected class |
PopupMenu.AccessibleAWTPopupMenu
用於為可存取性提供預設支持的 PopupMenu 的內部類別。 |
| 從類別 java.awt.Menu 繼承的巢狀類別/介面 |
|---|
Menu.AccessibleAWTMenu |
| 從類別 java.awt.MenuItem 繼承的巢狀類別/介面 |
|---|
MenuItem.AccessibleAWTMenuItem |
| 從類別 java.awt.MenuComponent 繼承的巢狀類別/介面 |
|---|
MenuComponent.AccessibleAWTMenuComponent |
| 建構子摘要 | |
|---|---|
PopupMenu()
創建具有空名稱的新彈出式選單。 |
|
PopupMenu(String label)
創建具有指定名稱的新彈出式選單。 |
|
| 方法摘要 | |
|---|---|
void |
addNotify()
創建彈出式選單的同位體。 |
AccessibleContext |
getAccessibleContext()
獲取與此 PopupMenu 關聯的 AccessibleContext。 |
MenuContainer |
getParent()
返回此選單元件的父容器。 |
void |
show(Component origin,
int x,
int y)
在相對於初始元件的 x、y 位置上顯示彈出式選單。 |
| 從類別 java.awt.Menu 繼承的方法 |
|---|
add, add, addSeparator, countItems, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotify |
| 從類別 java.awt.MenuComponent 繼承的方法 |
|---|
dispatchEvent, getFont, getName, getPeer, getTreeLock, postEvent, setFont, setName, toString |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 從介面 java.awt.MenuContainer 繼承的方法 |
|---|
getFont, postEvent |
| 建構子詳細資訊 |
|---|
public 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()
MenuComponent 中的 getParentnullpublic void addNotify()
Menu 中的 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。
Accessible 中的 getAccessibleContextMenu 中的 getAccessibleContextPopupMenu 的 AccessibleContext
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。