Java Doc for PopupMenu.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.MenuComponent
      java.awt.MenuItem
         java.awt.Menu
            java.awt.PopupMenu

PopupMenu
public class PopupMenu extends Menu (Code)
A class that implements a menu which can be dynamically popped up at a specified position within a component.

As the inheritance hierarchy implies, a PopupMenu can be used anywhere a Menu can be used. However, if you use a PopupMenu like a Menu (e.g., you add it to a MenuBar), then you cannot call show on that PopupMenu.
version:
   1.41 05/05/07
author:
   Amy Fowler


Inner Class :protected class AccessibleAWTPopupMenu extends AccessibleAWTMenu

Field Summary
transient  booleanisTrayIconPopup
    
static  intnameCounter
    

Constructor Summary
public  PopupMenu()
     Creates a new popup menu with an empty name.
public  PopupMenu(String label)
     Creates a new popup menu with the specified name.

Method Summary
public  voidaddNotify()
     Creates the popup menu's peer.
 StringconstructComponentName()
     Constructs a name for this MenuComponent.
public  AccessibleContextgetAccessibleContext()
     Gets the AccessibleContext associated with this PopupMenu.
public  MenuContainergetParent()
    
public  voidshow(Component origin, int x, int y)
     Shows the popup menu at the x, y position relative to an origin component. The origin component must be contained within the component hierarchy of the popup menu's parent.

Field Detail
isTrayIconPopup
transient boolean isTrayIconPopup(Code)



nameCounter
static int nameCounter(Code)




Constructor Detail
PopupMenu
public PopupMenu() throws HeadlessException(Code)
Creates a new popup menu with an empty name.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true.
See Also:   java.awt.GraphicsEnvironment.isHeadless



PopupMenu
public PopupMenu(String label) throws HeadlessException(Code)
Creates a new popup menu with the specified name.
Parameters:
  label - a non-null string specifyingthe popup menu's label
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true.
See Also:   java.awt.GraphicsEnvironment.isHeadless




Method Detail
addNotify
public void addNotify()(Code)
Creates the popup menu's peer. The peer allows us to change the appearance of the popup menu without changing any of the popup menu's functionality.



constructComponentName
String constructComponentName()(Code)
Constructs a name for this MenuComponent. Called by getName when the name is null.



getAccessibleContext
public AccessibleContext getAccessibleContext()(Code)
Gets the AccessibleContext associated with this PopupMenu. the AccessibleContext of thisPopupMenu
since:
   1.3



getParent
public MenuContainer getParent()(Code)



show
public void show(Component origin, int x, int y)(Code)
Shows the popup menu at the x, y position relative to an origin component. The origin component must be contained within the component hierarchy of the popup menu's parent. Both the origin and the parent must be showing on the screen for this method to be valid.

If this PopupMenu is being used as a Menu (i.e., it has a non-Component parent), then you cannot call this method on the PopupMenu.
Parameters:
  origin - the component which defines the coordinate space
Parameters:
  x - the x coordinate position to popup the menu
Parameters:
  y - the y coordinate position to popup the menu
exception:
  NullPointerException - if the parent is null
exception:
  IllegalArgumentException - if this PopupMenuhas a non-Component parent
exception:
  IllegalArgumentException - if the origin is not in theparent's heirarchy
exception:
  RuntimeException - if the parent is not showing on screen




Fields inherited from java.awt.Menu
boolean isHelpMenu(Code)(Java Doc)
Vector items(Code)(Java Doc)
boolean tearOff(Code)(Java Doc)

Methods inherited from java.awt.Menu
public MenuItem add(MenuItem mi)(Code)(Java Doc)
public void add(String label)(Code)(Java Doc)
public void addNotify()(Code)(Java Doc)
public void addSeparator()(Code)(Java Doc)
String constructComponentName()(Code)(Java Doc)
public int countItems()(Code)(Java Doc)
final int countItemsImpl()(Code)(Java Doc)
void deleteShortcut(MenuShortcut s)(Code)(Java Doc)
int getAccessibleChildIndex(MenuComponent child)(Code)(Java Doc)
public AccessibleContext getAccessibleContext()(Code)(Java Doc)
public MenuItem getItem(int index)(Code)(Java Doc)
public int getItemCount()(Code)(Java Doc)
final MenuItem getItemImpl(int index)(Code)(Java Doc)
MenuItem getShortcutMenuItem(MenuShortcut s)(Code)(Java Doc)
boolean handleShortcut(KeyEvent e)(Code)(Java Doc)
public void insert(MenuItem menuitem, int index)(Code)(Java Doc)
public void insert(String label, int index)(Code)(Java Doc)
public void insertSeparator(int index)(Code)(Java Doc)
public boolean isTearOff()(Code)(Java Doc)
public String paramString()(Code)(Java Doc)
public void remove(int index)(Code)(Java Doc)
public void remove(MenuComponent item)(Code)(Java Doc)
public void removeAll()(Code)(Java Doc)
public void removeNotify()(Code)(Java Doc)
synchronized Enumeration shortcuts()(Code)(Java Doc)

Fields inherited from java.awt.MenuItem
String actionCommand(Code)(Java Doc)
transient ActionListener actionListener(Code)(Java Doc)
boolean enabled(Code)(Java Doc)
long eventMask(Code)(Java Doc)
String label(Code)(Java Doc)

Methods inherited from java.awt.MenuItem
public synchronized void addActionListener(ActionListener l)(Code)(Java Doc)
public void addNotify()(Code)(Java Doc)
String constructComponentName()(Code)(Java Doc)
public void deleteShortcut()(Code)(Java Doc)
void deleteShortcut(MenuShortcut s)(Code)(Java Doc)
public synchronized void disable()(Code)(Java Doc)
final protected void disableEvents(long eventsToDisable)(Code)(Java Doc)
void doMenuEvent(long when, int modifiers)(Code)(Java Doc)
public synchronized void enable()(Code)(Java Doc)
public void enable(boolean b)(Code)(Java Doc)
final protected void enableEvents(long eventsToEnable)(Code)(Java Doc)
boolean eventEnabled(AWTEvent e)(Code)(Java Doc)
public AccessibleContext getAccessibleContext()(Code)(Java Doc)
public String getActionCommand()(Code)(Java Doc)
final String getActionCommandImpl()(Code)(Java Doc)
public synchronized ActionListener[] getActionListeners()(Code)(Java Doc)
public String getLabel()(Code)(Java Doc)
public T[] getListeners(Class<T> listenerType)(Code)(Java Doc)
public MenuShortcut getShortcut()(Code)(Java Doc)
MenuItem getShortcutMenuItem(MenuShortcut s)(Code)(Java Doc)
boolean handleShortcut(KeyEvent e)(Code)(Java Doc)
public boolean isEnabled()(Code)(Java Doc)
public String paramString()(Code)(Java Doc)
protected void processActionEvent(ActionEvent e)(Code)(Java Doc)
protected void processEvent(AWTEvent e)(Code)(Java Doc)
public synchronized void removeActionListener(ActionListener l)(Code)(Java Doc)
public void setActionCommand(String command)(Code)(Java Doc)
public synchronized void setEnabled(boolean b)(Code)(Java Doc)
public synchronized void setLabel(String label)(Code)(Java Doc)
public void setShortcut(MenuShortcut s)(Code)(Java Doc)

Fields inherited from java.awt.MenuComponent
AccessibleContext accessibleContext(Code)(Java Doc)
final static String actionListenerK(Code)(Java Doc)
transient AppContext appContext(Code)(Java Doc)
Font font(Code)(Java Doc)
final static String itemListenerK(Code)(Java Doc)
boolean newEventsOnly(Code)(Java Doc)
transient MenuContainer parent(Code)(Java Doc)
transient MenuComponentPeer peer(Code)(Java Doc)

Methods inherited from java.awt.MenuComponent
String constructComponentName()(Code)(Java Doc)
final public void dispatchEvent(AWTEvent e)(Code)(Java Doc)
void dispatchEventImpl(AWTEvent e)(Code)(Java Doc)
boolean eventEnabled(AWTEvent e)(Code)(Java Doc)
int getAccessibleChildIndex(MenuComponent child)(Code)(Java Doc)
public AccessibleContext getAccessibleContext()(Code)(Java Doc)
int getAccessibleIndexInParent()(Code)(Java Doc)
AccessibleStateSet getAccessibleStateSet()(Code)(Java Doc)
public Font getFont()(Code)(Java Doc)
final Font getFont_NoClientCode()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public MenuContainer getParent()(Code)(Java Doc)
final MenuContainer getParent_NoClientCode()(Code)(Java Doc)
public MenuComponentPeer getPeer()(Code)(Java Doc)
final protected Object getTreeLock()(Code)(Java Doc)
protected String paramString()(Code)(Java Doc)
public boolean postEvent(Event evt)(Code)(Java Doc)
protected void processEvent(AWTEvent e)(Code)(Java Doc)
public void removeNotify()(Code)(Java Doc)
public void setFont(Font f)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.