| Author |
Action for JMenuItem
|
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
Hello, is this possible to add Action for this component?
JMenuItem
I mean this one:
Bookmark called Html (from screen) is called: jMenuItem7
And I did something like this:
But nothing happedned.
Someone can help me? Is there any other way (or maybe its impossible)
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4165
|
|
Recommended reading:
http://catb.org/~esr/faqs/smart-questions.html
http://mindprod.com/jgloss/sscce.html
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
In my opinion its well explained, what else should I post..
Simple question, is therey any way to add action for JMenuItem
This one.. :
.
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
In my opinion its well explained,
No it is not well explained. A JMenuItem is typically added to a JMenu, but your picture looks more like a tabbed pane. Menu items are displayed below a JMenu when the menu is clicked.
That is why you should always post a SSCCE when you post a question so we don't have to guess what you are talking about.
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
|
It is a tabbed pane.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
So the entire question is wrong.
JTabbedPane works with ChangeListener when its tab is changed. Try that out.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
Could you show me little example how to use this one?
Yes i saw your link and also I saw guide on sun website but still cant understand how does it work.
I have something like this
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
Ok, thank you I think I got it a bit.
But now should I create something like:
But of course its wrong, can you help me one more time?
Sorry anyway.
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
Ok, thank you I think I got it a bit.
But now should I create something like:
But of course its wrong, can you help me one more time?
Sorry anyway.
/edit - ok thank you, already done.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
What's wrong with that? Please TellTheDetails.
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
I did it in another method, anyway works.
Something like:
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
I do hope you use the equals method to compare Strings, not ==.
|
 |
Mathew Mintalm
Ranch Hand
Joined: Feb 21, 2010
Posts: 102
|
|
|
Oh, right :P Thank you.
|
 |
 |
|
|
subject: Action for JMenuItem
|
|
|