Which of these classes can be added to a Frame component. Select all correct answers. 1.Menu 2.Button 3.PopupMenu 4.Window 5.List Acc.to javaprepare,the answer is 2,3,5. But,i think it's 1,2,3,5.All except Window,in this list can be added to a Frame.Pl.clarify.
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
posted
0
Check the API Spec. You can add anything that extends Component to a Frame. Menu, however, extends MenuComponent, so it can't be added. Corey [ May 29, 2002: Message edited by: Corey McGlone ]
I thing that we can use MenuBar with Frame using setMenuBar and we should add menu to menubar. Please correct if I am wrong.
geetha nagarajan
Ranch Hand
Joined: Jul 13, 2001
Posts: 94
posted
0
Acc.to mughal(chp 12): A frame is an optionally user resizable and movable top level window ,that can have a title-bar,an icon and menus. Pl.clarify.
geetha nagarajan
Ranch Hand
Joined: Jul 13, 2001
Posts: 94
posted
0
Ya,i think we can add menubars to Frame ,using methods like setMenuBar().
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
posted
0
I'm sorry, I accidentally pulled that from the Window API Spec, rather than the Frame API Spec. However, you still can't "add" a menu to a Frame. The add methods take Components, not MenuComponents. Rather you use the setMenuBar method to place a menu into the Frame. The original question asks, speicifically, which ones can be "added" to the frame. A menu can not be. I hope that helps, Corey