• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Action for JMenuItem

 
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recommended reading:
http://catb.org/~esr/faqs/smart-questions.html
http://mindprod.com/jgloss/sscce.html
 
Mathew Mintalm
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion its well explained, what else should I post..

Simple question, is therey any way to add action for JMenuItem

This one.. :



.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is a tabbed pane.
 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the entire question is wrong.

JTabbedPane works with ChangeListener when its tab is changed. Try that out.
 
Mathew Mintalm
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Mathew Mintalm
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's wrong with that? Please TellTheDetails.
 
Mathew Mintalm
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did it in another method, anyway works.

Something like:

 
Rob Spoor
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do hope you use the equals method to compare Strings, not ==.
 
Mathew Mintalm
Ranch Hand
Posts: 103
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, right :P Thank you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic