• Post Reply Bookmark Topic Watch Topic
  • New Topic

A question about adding a menu to a frame.  RSS feed

 
hills_water
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a newcomer in JAVA,but I have interests to learn it better.I write a program about a frame with menu.When the program is run in JBuilder,everything is ok,but when I open the html file which includes the program,the added menu is invisible.What would the matter be? hills_water@163.com
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
A menu can only be placed onto a Frame. If you are using HTML to display your program then you have an Applet (not a Frame). Therefore, no menu!
You can have your applet create/display a frame containing a menu, or
You can use JavaScript to get a menu.
Regards,
Manfred.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"hills_water" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, if you extends JApplet, then you CAN put a JMenuBar on the ContentPane of the Applet. However, I don't know how you would control the HTML content from this JMenu.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!