• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMenu

 
rama krishnan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its possible adding the Jmenubar in the JPanel, I tried this one but I didn't get the result
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JMenuBar should only be used for JFrame, JDialog, JApplet, JInternalFrame and JRootPane. Those all have a method called setJMenuBar with which you can set the JMenuBar.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Its possible adding the Jmenubar in the JPanel

worked OK for me.
 
rama krishnan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the result, JMeuBar is working in the JPanel
by setting the BorderLayout for Jpanel
 
Konstantin Chikarev
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Funny, it really works. I never even thought about using menu as usual component
 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A great thing about Swing, any component can generally be added to any container...regardless of whether it makes sense or not (grin).


[ August 13, 2008: Message edited by: Gil Estes ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!