Hi Bruno,

You need to add implement the MenuHandler interface and set it on your
TreeView (you can just extend MenuHandler.Adapter to make your life
easier). In your configureContextMenu method, do something similar to this:

        @Override
        public boolean configureContextMenu( Component component, Menu
menu, int x, int y )
        {
            Menu.Section topLevelMenuSection = new Menu.Section();
            menu.getSections().add( topLevelMenuSection );
            Menu.Item menuItem = new Menu.Item( "My Menu Item ");
            topLevelMenuSection.add( menuItem );
            return false;
        }

Hope this helps.

Joseph.


On Thu, Jul 5, 2012 at 7:28 PM, Bruno Rodrigues <[email protected]> wrote:

> hello, guys!
>
> you know how to create a listener to show a menu when pressing right click
> on a tree node? my question is clear?
> I have already a listener created for a right click, doing a simple
> System.out.print(), and I dont know how to add a context menu.
>
> thanks!
>

Reply via email to