• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Menu Question

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TRUE or FALSE
Only Frames can contain menu bars or pull-down menus.
I think it is true.
But a mock exam's anwser is false.
Can anyone clear this?
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also came across this question probably from jxam .
I think the given answer is wrong because only Frame class has the method setMenuBar() so we can attach a menu bar only to a Frame.
please someone verify me..
[This message has been edited by Nasir Khan (edited November 26, 2000).]
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
A menubar can be added only to a Frame. So the answer is TRUE.
Menubars cannot be added to a Frame by using the add() method.
The method used for adding menubar to a Frame is,
setMenubar(menuBar);
FYI:
You can add only one menu bar to a Frame directly. The reason for not using the add() method for menubar is because the menubar is not a Component like Button,Checkbox etc.
Each Frame has an instance variable of type MenuBar. So you set this instance variable by using the setMenuBar() method.
- Suresh Selvaraj
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bin Zhao:
TRUE or FALSE
Only Frames can contain menu bars or pull-down menus.
I think it is true.
But a mock exam's anwser is false.
Can anyone clear this?



Bin Zhao,
as your question states "Only frames can contain menubar or pull-down menus"
my ans for that question is false.
explaination ---->
mind a "or" is involved in the question. and this is not logical or which we generally used in programming languages . this means here that both of the segment "menubar" & "pulldown menu" should be considered separately and then ans.
the first part of this question about menu bar is true that only frames can contain menubar but for "pull-down menu"
i want to give some args in that favour.
generally people think that pull down menu is a menu which is attatched to frame directly (0 level). but this is not true in this concrens. because a pull down menu is a menu which get down on pull ( or selecting) and probabely you have seen all ready that a popup menu can contain pull down menu's. and no doubt
popup menus can be attached to a lot of awt components. so by this way a lot of awt components can contain pull down menus.
so second segment is false here that's why entire question returns false here.
(this is only my openion in the favour of that ans given by the author of that question containing mock exam.)
 
This one time, at bandcamp, I had relations with a tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic