Java Doc for CheckboxMenuItem.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.CheckboxMenuItem

CheckboxMenuItem
public class CheckboxMenuItem extends MenuItem implements ItemSelectable(Code)
This class represents a check box that can be included in a menu. Clicking on the check box in the menu changes its state from "on" to "off" or from "off" to "on."

The following picture depicts a menu which contains an instance of CheckBoxMenuItem:

The item labeled Check shows a check box menu item in its "off" state.

When a check box menu item is selected, AWT sends an item event to the item. Since the event is an instance of ItemEvent, the processEvent method examines the event and passes it along to processItemEvent. The latter method redirects the event to any ItemListener objects that have registered an interest in item events generated by this menu item.
version:
   1.44, 08/19/02
author:
   Sami Shaio
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.event.ItemListener
See Also:   java.awt.Frame
See Also:   java.awt.Menu
See Also:   java.awt.MenuBar
See Also:   java.awt.PopupMenu
See Also:   java.awt.MenuShortcut
since:
   JDK1.0



Field Summary
transient  ItemListeneritemListener
    
 booleanstate
    

Constructor Summary
public  CheckboxMenuItem()
     Create a check box menu item with an empty label.
public  CheckboxMenuItem(String label)
     Create a check box menu item with the specified label.
public  CheckboxMenuItem(String label, boolean state)
     Create a check box menu item with the specified label and state.

Method Summary
public synchronized  voidaddItemListener(ItemListener l)
     Adds the specified item listener to receive item events from this check box menu item.
public  voidaddNotify()
     Creates the peer of the checkbox item.
 voiddoMenuEvent()
    
 booleaneventEnabled(AWTEvent e)
    
public synchronized  ItemListener[]getItemListeners()
     Returns an array of all the item listeners registered on this checkbox menuitem.
public synchronized  Object[]getSelectedObjects()
     Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
public  booleangetState()
    
public  StringparamString()
     Returns the parameter string representing the state of this check box menu item.
protected  voidprocessEvent(AWTEvent e)
     Processes events on this check box menu item.
protected  voidprocessItemEvent(ItemEvent e)
     Processes item events occurring on this check box menu item by dispatching them to any registered ItemListener objects.

This method is not called unless item events are enabled for this menu item.

public synchronized  voidremoveItemListener(ItemListener l)
     Removes the specified item listener so that it no longer receives item events from this check box menu item.
public synchronized  voidsetState(boolean b)
     Sets this check box menu item to the specifed state.

Field Detail
itemListener
transient ItemListener itemListener(Code)



state
boolean state(Code)




Constructor Detail
CheckboxMenuItem
public CheckboxMenuItem()(Code)
Create a check box menu item with an empty label. The item's state is initially set to "off."
since:
   JDK1.1



CheckboxMenuItem
public CheckboxMenuItem(String label)(Code)
Create a check box menu item with the specified label. The item's state is initially set to "off."
Parameters:
  label - a string label for the check box menu item,or null for an unlabeled menu item.



CheckboxMenuItem
public CheckboxMenuItem(String label, boolean state)(Code)
Create a check box menu item with the specified label and state.
Parameters:
  label - a string label for the check box menu item, or null for an unlabeled menu item.
Parameters:
  state - the initial state of the menu item, wheretrue indicates "on" andfalse indicates "off."
since:
   JDK1.1




Method Detail
addItemListener
public synchronized void addItemListener(ItemListener l)(Code)
Adds the specified item listener to receive item events from this check box menu item. If l is null, no exception is thrown and no action is performed.
Parameters:
  l - the item listener
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.event.ItemListener
See Also:   java.awt.Choice.removeItemListener
since:
   JDK1.1



addNotify
public void addNotify()(Code)
Creates the peer of the checkbox item. This peer allows us to change the look of the checkbox item without changing its functionality. Most applications do not call this method directly.
See Also:   java.awt.Toolkit.createCheckboxMenuItem(java.awt.CheckboxMenuItem)
See Also:   java.awt.Component.getToolkit
since:
   JDK1.0



doMenuEvent
void doMenuEvent()(Code)



eventEnabled
boolean eventEnabled(AWTEvent e)(Code)



getItemListeners
public synchronized ItemListener[] getItemListeners()(Code)
Returns an array of all the item listeners registered on this checkbox menuitem. all of this checkbox menuitem's ItemListenersor an empty array if no itemlisteners are currently registered
See Also:   CheckboxMenuItem.addItemListener
See Also:   CheckboxMenuItem.removeItemListener
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.event.ItemListener
since:
   1.4



getSelectedObjects
public synchronized Object[] getSelectedObjects()(Code)
Returns the an array (length 1) containing the checkbox menu item label or null if the checkbox is not selected.
See Also:   ItemSelectable



getState
public boolean getState()(Code)
Determines whether the state of this check box menu item is "on" or "off." the state of this check box menu item, wheretrue indicates "on" andfalse indicates "off."
See Also:   java.awt.CheckboxMenuItem.setState



paramString
public String paramString()(Code)
Returns the parameter string representing the state of this check box menu item. This string is useful for debugging. the parameter string of this check box menu item.



processEvent
protected void processEvent(AWTEvent e)(Code)
Processes events on this check box menu item. If the event is an instance of ItemEvent, this method invokes the processItemEvent method. If the event is not an item event, it invokes processEvent on the superclass.

Check box menu items currently support only item events.
Parameters:
  e - the event
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.CheckboxMenuItem.processItemEvent
since:
   JDK1.1




processItemEvent
protected void processItemEvent(ItemEvent e)(Code)
Processes item events occurring on this check box menu item by dispatching them to any registered ItemListener objects.

This method is not called unless item events are enabled for this menu item. Item events are enabled when one of the following occurs:

  • An ItemListener object is registered via addItemListener.
  • Item events are enabled via enableEvents.

Parameters:
  e - the item event.
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.event.ItemListener
See Also:   java.awt.CheckboxMenuItem.addItemListener
See Also:   java.awt.MenuItem.enableEvents
since:
   JDK1.1



removeItemListener
public synchronized void removeItemListener(ItemListener l)(Code)
Removes the specified item listener so that it no longer receives item events from this check box menu item. If l is null, no exception is thrown and no action is performed.
Parameters:
  l - the item listener
See Also:   java.awt.event.ItemEvent
See Also:   java.awt.event.ItemListener
See Also:   java.awt.Choice.addItemListener
since:
   JDK1.1



setState
public synchronized void setState(boolean b)(Code)
Sets this check box menu item to the specifed state. The boolean value true indicates "on" while false indicates "off."
Parameters:
  b - the boolean state of thischeck box menu item.
See Also:   java.awt.CheckboxMenuItem.getState



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.