NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Kubis
Joined: 09 Apr 2012 Posts: 3
|
Posted: Mon Apr 09, 2012 2:31 pm Post subject: How to create a menuItem ToolTip? |
|
|
Hi everybody,
I have a specific problem. I create a new modul in NetBeans Platform and I don´t know, how to add ToolTip to my menuItem (this menuItem starts my modul).
If I create normal swing application, there is no problem with ToolTips. I only edit toolTipText field in menuItem properties. But in this case, I define menuItem in layer.xml, so how can I do that?
Thanks for any advice or solution |
|
| Back to top |
|
 |
sandgorgon
Joined: 11 Apr 2012 Posts: 20
|
Posted: Thu Apr 12, 2012 10:41 pm Post subject: |
|
|
Very new to the Netbeans Platform, but maybe you have an Action for your MenuItem you can do the same thing that I did...
http://forums.netbeans.org/viewtopic.php?t=47490
...and set the tool tip text right before you return the MenuPresenter from the getMenuPresenter() method.
Of course, I am new to all of this so I don't know _the_ right_way_ to do it.
Regards,
Nom |
|
| Back to top |
|
 |
Kubis
Joined: 09 Apr 2012 Posts: 3
|
Posted: Fri Apr 13, 2012 9:55 pm Post subject: |
|
|
| sandgorgon wrote: | Very new to the Netbeans Platform, but maybe you have an Action for your MenuItem you can do the same thing that I did...
http://forums.netbeans.org/viewtopic.php?t=47490
...and set the tool tip text right before you return the MenuPresenter from the getMenuPresenter() method.
Of course, I am new to all of this so I don't know _the_ right_way_ to do it.
Regards,
Nom |
First of all, thanks for your help.
Yes, I using NodeAction for my MenuItem. But I´m not sure, how you thinking that. I have this method and what next?
| Code: |
@Override
public JMenuItem getMenuPresenter() {
return super.getMenuPresenter();
}
|
|
|
| Back to top |
|
 |
sandgorgon
Joined: 11 Apr 2012 Posts: 20
|
Posted: Thu Apr 19, 2012 5:39 pm Post subject: |
|
|
Hope this works for you...
| Code: |
@Override
public JMenuItem getMenuPresenter() {
JMenuItem mi = super.getMenuPresenter();
mi.setToolTipText("Your text");
return mi;
}
|
|
|
| Back to top |
|
 |
Kubis
Joined: 09 Apr 2012 Posts: 3
|
Posted: Thu Apr 26, 2012 2:23 pm Post subject: |
|
|
| WORKS. Thanks for help... |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|