Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between MenuBar and MenuItem

 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is difference between MenuBar and MenuItem...
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Nil Pat"
Please check your private messages for an important administrative matter
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Coming back to your question. From the API docs
A standard menu bar widget. A menu bar can contain any number of menu items, each of which can either fire a Command or open a cascaded menu bar.

An entry in a MenuBar. Menu items can either fire a Command when they are clicked, or open a cascading sub-menu


Consider an application with File, Edit, View etc. The component on which these are displayed is the MenuBar. File Edit etc are the menus.

 
Ganesan Ponnusamy
MyExamCloud Support
Ranch Hand
Posts: 264
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A menu provides a space-saving way to let the user choose one of several options. Other components with which the user can make a one-of-many choice include combo boxes, lists, radio buttons, spinners, and tool bars.

Menus are unique in that, by convention, they aren't placed with the other components in the UI. Instead, a menu usually appears either in a menu bar or as a popup menu. A menu bar contains one or more menus and has a customary, platform-dependent location — usually along the top of a window. A popup menu is a menu that is invisible until the user makes a platform-specific mouse action, such as pressing the right mouse button, over a popup-enabled component. The popup menu then appears under the cursor.

Read more at http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ganesan,
Since the OP has asked the question in the GWT forum, I doubt the link you have provided would be relevant.
 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Coming back to your question. From the API docs
A standard menu bar widget. A menu bar can contain any number of menu items, each of which can either fire a Command or open a cascaded menu bar.

An entry in a MenuBar. Menu items can either fire a Command when they are clicked, or open a cascading sub-menu


Consider an application with File, Edit, View etc. The component on which these are displayed is the MenuBar. File Edit etc are the menus.





Thanks for your replay but,
i m asking, we can give command in MenuBar. then what is real need of MenuItem???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic