Java Doc for Menu.java in  » 6.0-JDK-Modules » j2me » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

All known Subclasses:   java.awt.PopupMenu,
Menu
public class Menu extends MenuItem implements MenuContainer(Code)
A Menu object is a pull-down menu component that is deployed from a menu bar.

A menu can optionally be a tear-off menu. A tear-off menu can be opened and dragged away from its parent menu bar or menu. It remains on the screen after the mouse button has been released. The mechanism for tearing off a menu is platform dependent, since the look and feel of the tear-off menu is determined by its peer. On platforms that do not support tear-off menus, the tear-off property is ignored.

Each item in a menu must belong to the MenuItem class. It can be an instance of MenuItem, a submenu (an instance of Menu), or a check box (an instance of CheckboxMenuItem).
version:
   1.55, 08/19/02
author:
   Sami Shaio
See Also:   java.awt.MenuItem
See Also:   java.awt.MenuBar
See Also:   java.awt.MenuShortcut
See Also:   java.awt.CheckboxMenuItem
See Also:   java.awt.Frame
since:
   JDK1.0



Field Summary
 booleanisHelpMenu
     This field will be set to true if the Menu in question is actually a help menu.
 Vectoritems
     A vector of the items that will be part of the Menu.
 booleantearOff
     This field indicates whether the menu has the tear of property or not.

Constructor Summary
public  Menu()
     Constructs a new menu with an empty label.
public  Menu(String label)
     Constructs a new menu with the specified label.
public  Menu(String label, boolean tearOff)
     Constructs a new menu with the specified label, indicating whether the menu can be torn off.

Tear-off functionality may not be supported by all implementations of AWT.


Method Summary
public  MenuItemadd(MenuItem mi)
     Adds the specified menu item to this menu.
public  voidadd(String label)
     Adds an item with the specified label to this menu.
public  voidaddNotify()
     Creates the menu's peer.
public  voidaddSeparator()
     Adds a separator line, or a hypen, to the menu at the current position.
 StringconstructComponentName()
     Construct a name for this MenuComponent.
public  intcountItems()
    
 voiddeleteShortcut(MenuShortcut s)
    
public  MenuItemgetItem(int index)
     Gets the item located at the specified index of this menu.
Parameters:
  index - the position of the item to be returned.
public  intgetItemCount()
     Get the number of items in this menu.
 MenuItemgetShortcutMenuItem(MenuShortcut s)
    
 booleanhandleShortcut(KeyEvent e)
    
public  voidinsert(MenuItem menuitem, int index)
     Inserts a menu item into this menu at the specified position.
public  voidinsert(String label, int index)
     Inserts a menu item with the specified label into this menu at the specified position.
public  voidinsertSeparator(int index)
     Inserts a separator at the specified position.
public  booleanisTearOff()
     Indicates whether this menu is a tear-off menu.

Tear-off functionality may not be supported by all implementations of AWT.

public  StringparamString()
     Gets the parameter string representing the state of this menu.
public  voidremove(int index)
     Removes the menu item at the specified index from this menu.
public  voidremove(MenuComponent item)
     Removes the specified menu item from this menu.
Parameters:
  item - the item to be removed from the menu.
public  voidremoveAll()
     Removes all items from this menu.
public  voidremoveNotify()
     Removes the menu's peer.
synchronized  Enumerationshortcuts()
    

Field Detail
isHelpMenu
boolean isHelpMenu(Code)
This field will be set to true if the Menu in question is actually a help menu. Otherwise it will be set to false.



items
Vector items(Code)
A vector of the items that will be part of the Menu.
See Also:    countItems()



tearOff
boolean tearOff(Code)
This field indicates whether the menu has the tear of property or not. It will be set to true if the menu has the tear off property and it will be set to false> if it does not. A torn off menu can be deleted by a user when it is no longer needed.
See Also:    isTearOff()




Constructor Detail
Menu
public Menu()(Code)
Constructs a new menu with an empty label. This menu is not a tear-off menu.
since:
   JDK1.1



Menu
public Menu(String label)(Code)
Constructs a new menu with the specified label. This menu is not a tear-off menu.
Parameters:
  label - the menu's label in the menu bar, or inanother menu of which this menu is a submenu.



Menu
public Menu(String label, boolean tearOff)(Code)
Constructs a new menu with the specified label, indicating whether the menu can be torn off.

Tear-off functionality may not be supported by all implementations of AWT. If a particular implementation doesn't support tear-off menus, this value is silently ignored.
Parameters:
  label - the menu's label in the menu bar, or inanother menu of which this menu is a submenu.
Parameters:
  tearOff - if true, the menuis a tear-off menu.
since:
   JDK1.0.





Method Detail
add
public MenuItem add(MenuItem mi)(Code)
Adds the specified menu item to this menu. If the menu item has been part of another menu, remove it from that menu.
Parameters:
  mi - the menu item to be added. the menu item added.
See Also:   java.awt.Menu.insert(java.lang.Stringint)
See Also:   java.awt.Menu.insert(java.awt.MenuItemint)



add
public void add(String label)(Code)
Adds an item with the specified label to this menu.
Parameters:
  label - the text on the item.
See Also:   java.awt.Menu.insert(java.lang.Stringint)
See Also:   java.awt.Menu.insert(java.awt.MenuItemint)



addNotify
public void addNotify()(Code)
Creates the menu's peer. The peer allows us to modify the appearance of the menu without changing its functionality.



addSeparator
public void addSeparator()(Code)
Adds a separator line, or a hypen, to the menu at the current position.
See Also:   java.awt.Menu.insertSeparator(int)



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



countItems
public int countItems()(Code)



deleteShortcut
void deleteShortcut(MenuShortcut s)(Code)



getItem
public MenuItem getItem(int index)(Code)
Gets the item located at the specified index of this menu.
Parameters:
  index - the position of the item to be returned. the item located at the specified index.



getItemCount
public int getItemCount()(Code)
Get the number of items in this menu. the number of items in this menu.
since:
   JDK1.1



getShortcutMenuItem
MenuItem getShortcutMenuItem(MenuShortcut s)(Code)



handleShortcut
boolean handleShortcut(KeyEvent e)(Code)



insert
public void insert(MenuItem menuitem, int index)(Code)
Inserts a menu item into this menu at the specified position.
Parameters:
  menuitem - the menu item to be inserted.
Parameters:
  index - the position at which the menuitem should be inserted.
See Also:   java.awt.Menu.add(java.lang.String)
See Also:   java.awt.Menu.add(java.awt.MenuItem)
exception:
  IllegalArgumentException - if the value ofindex is less than zero.
since:
   JDK1.1



insert
public void insert(String label, int index)(Code)
Inserts a menu item with the specified label into this menu at the specified position.
Parameters:
  label - the text on the item.
Parameters:
  index - the position at which the menu itemshould be inserted.
See Also:   java.awt.Menu.add(java.lang.String)
See Also:   java.awt.Menu.add(java.awt.MenuItem)
since:
   JDK1.1



insertSeparator
public void insertSeparator(int index)(Code)
Inserts a separator at the specified position.
Parameters:
  index - the position at which themenu separator should be inserted.
exception:
  IllegalArgumentException - if the value ofindex is less than 0.
See Also:   java.awt.Menu.addSeparator
since:
   JDK1.1



isTearOff
public boolean isTearOff()(Code)
Indicates whether this menu is a tear-off menu.

Tear-off functionality may not be supported by all implementations of AWT. If a particular implementation doesn't support tear-off menus, this value is silently ignored. true if this is a tear-off menu;false otherwise.




paramString
public String paramString()(Code)
Gets the parameter string representing the state of this menu. This string is useful for debugging.
since:
   JDK1.0nu.



remove
public void remove(int index)(Code)
Removes the menu item at the specified index from this menu.
Parameters:
  index - the position of the item to be removed.



remove
public void remove(MenuComponent item)(Code)
Removes the specified menu item from this menu.
Parameters:
  item - the item to be removed from the menu. If item is null or is not in this menu, this method does nothing.



removeAll
public void removeAll()(Code)
Removes all items from this menu.
since:
   JDK1.0.



removeNotify
public void removeNotify()(Code)
Removes the menu's peer. The peer allows us to modify the appearance of the menu without changing its functionality.



shortcuts
synchronized Enumeration shortcuts()(Code)



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()(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 String getActionCommand()(Code)(Java Doc)
public synchronized ActionListener[] getActionListeners()(Code)(Java Doc)
public String getLabel()(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
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)
public Font getFont()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public MenuContainer getParent()(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
public boolean equals(Object obj)(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.