A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Mongo DB Applied Patterns
this week in the
MongoDB
forum
or a resume review from
Five Year Itch
in the
Jobs Discussion
forum!
JavaRanch
»
Java Forums
»
Java
»
Swing / AWT / SWT
Author
JMenuItems
Chase Bond
Greenhorn
Joined: May 20, 2009
Posts: 3
posted
May 20, 2009 12:43:59
0
I am trying to write a GUI that has a menu, with JMenuItems, and JMenuItems inside JMenuItems. But every time I try to add JMenuItems to JMenuItems they overwrite the name of the previous
JMenuItem
. How can I fix this problem?
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19214
I like...
posted
May 20, 2009 12:58:24
0
Use JMenus as
JMenuItem
containers.
JMenu
extends
JMenuItem
so you can use a
JMenu
everywhere you can use a
JMenuItem
.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions
How To Answer Questions
Chase Bond
Greenhorn
Joined: May 20, 2009
Posts: 3
posted
May 20, 2009 13:07:53
0
Thanks. I am new at this so can you show me how I could use it as a container?
Chase Bond
Greenhorn
Joined: May 20, 2009
Posts: 3
posted
May 20, 2009 13:15:01
0
Never Mind my last comment I just figured it out. Thanks anyways!
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
May 20, 2009 13:15:24
0
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: JMenuItems
Similar Threads
Wow 98% : I made it with your wishes!!!
Static blocks
JMenu items creating problems
Any body implemented File Drag and Drop with GWT?
how to create tablespace in java dbms
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter