NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How to create a menuItem ToolTip?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Kubis



Joined: 09 Apr 2012
Posts: 3

PostPosted: Mon Apr 09, 2012 2:31 pm    Post subject: How to create a menuItem ToolTip? Reply with quote

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

PostPosted: Thu Apr 12, 2012 10:41 pm    Post subject: Reply with quote

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

PostPosted: Fri Apr 13, 2012 9:55 pm    Post subject: Reply with quote

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

PostPosted: Thu Apr 19, 2012 5:39 pm    Post subject: Reply with quote

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

PostPosted: Thu Apr 26, 2012 2:23 pm    Post subject: Reply with quote

WORKS. Thanks for help...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo