• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Menus in AWT applet?

 
Ranch Hand
Posts: 420
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I put a menu at the top of my applet?
------------------
 
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: 420
  • 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.
 
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).]
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic