Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Menus in AWT applet?

 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I put a menu at the top of my applet?
------------------
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siegfried,
You can not place a menu or menubar directly onto an AWT applet. You can however do the following.
In your applet's init() method, create a Frame instance and then attach the Menus, Menubar etc to that frame.
Or you could just use a popup menu and attach it directly to the applet.
Regards,
Manfred.
 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manfred.
I tried poping up a frame and that was kind of ugly (not to mention confusing) for the user. The window border and the system menu(the "X" and the "_" in the upper right corner) really make it look like a seperate application.
Is there a way I could add the frame to a panel to keep it from floating around and then surpress the frame and the system menu? I tried the obvious (the add member function of panel) and received a run time error.
Is there a way I could permenantly position a popup menu in a panel?
Thanks,
Siegfried
------------------
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siegfried,
No you can not add a top level component to a panel so that option is out.
You can permanently position a popup menu but I don't think you can permanently display it ...
Why not just use a popup menu in your applet. Most applets that I have seen use popups without any great problems and most users seem to understand how to bring them up quite well.
Regards,
Manfred.
 
Amit Dubey
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI..
Since you know u cannot add amenu directly u have a option of using popup menus..
This is very simple.Use a Panel and have the width as tht of a Menu.Then add Labels to it such that they represent the Menu names.Then on click of the mouse on each Label open a Pop Up Menu at that Label location.This is very simple and looks as if we are using a menu.Th user will not get confused.I have used it my application.It works well
[This message has been edited by Amit Dubey (edited July 07, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic