Nalini,
Here is little (may be 70 watts

) help.
To clear your doubt, I again digged into both
Sun's source code and the
archived AWT tutorial from Sun.
From Sun's AWT tutorial Menu functionality in the AWT is provided by several classes. These classes do not inherit from Component, since many platforms place severe limits on menu capabilities. Instead, menu classes inherit from the MenuComponent class.
To be able to contain a MenuComponent, an object must adhere to the MenuContainer interface.
The Frame, Menu, and MenuBar classes are the only AWT classes that currently implement MenuContainer. In order to verify what is said in the Tutorial, I extracted the source code for both 'Component' and 'Frame' classes. I found that eventhough the documentation for 'Component' class in the API and in the source code also says 'implements MenuContainer', internally ONLY the 'Frame' class FULLY /gives TRUE implemetation for the
remove(MenuComponent m) method from the MenuContainer interface. The class Component gives
partial implementation of the MenuComtainer interface. Partial implementation in the sense, Component class is implemnted to
remove ONLY PopupMenu NOT All MenuComponents.
And also as you told, Only Frame has got a method
setMenuBar(MenuBar m) to attach a menu. All decendents from Component class have only
add(Component c) related methods. Since the
java.awt.MenuComponent hirearchy is COMPLETELY a DIFFERENT branch we can't attach a MEnuComponent to a Component. This also adds to our argument of
Only Frames can have Menu bars .

So for your qstns we have to select only Frame.

regds
maha anna
The source code for MenuContainer interface ------------------------------------------------
<pre>
public interface MenuContainer {
Font getFont();
void remove(MenuComponent comp); boolean postEvent(Event evt);
}
</pre>
The source code for Component ------------------------------------------------
<pre>
public synchronized void
remove(MenuComponent popup) {
if (popups != null) {
int index = popups.indexOf(popup);
if (index >= 0) {
PopupMenu pmenu = (PopupMenu)popup;
if (pmenu.peer != null) {
pmenu.removeNotify();
}
pmenu.parent = null;
popups.removeElementAt(index);
if (popups.size() == 0) {
popups = null;
}
}
}
}
</pre>
The source code for Frame ------------------------------------------------
<pre>
public void
remove(MenuComponent m) {
synchronized (getTreeLock()) {
if (m == menuBar) {
menuBar = null;
FramePeer peer = (FramePeer)this.peer;
if (peer != null) {
mbManagement = true;
if (valid) {
invalidate();
}
peer.setMenuBar(null);
m.removeNotify();
}
m.parent = null;
} else {
super.remove(m);
}
}
}
</pre>
[This message has been edited by maha anna (edited May 08, 2000).]