How can I add a context menu to control nodes?

I want to add a context menu to a rectangle, but currently the popup menu can only be added to control nodes. What is the reason behind this?

I guess this is same reason that the ToolTip has a static installation for nodes in control - i.e. method for javafx.scene classes as node have a dependency on javafx.control classes.

Add an eventhandler to your rectangle (e.g. mouseclicked) and call contextMenu.show () in the eventhandler.
http://docs.Oracle.com/JavaFX/2.0/API/JavaFX/scene/node.html#setOnMouseClicked%28javafx.event.EventHandler%29
http://docs.Oracle.com/JavaFX/2.0/API/JavaFX/scene/control/ContextMenu.html#show%28javafx.scene.node, %20javafx.geometry.Side,%20double,%20double%29

Tags: Java

Similar Questions

  • How can you add a context Menu to a TableView header?

    How can you add a context Menu to a TableView header?

    I would like to add a context menu to a table header that allows you to select the columns that are displayed in a table. I'll give a list of available columns that the user can select.

    See you soon,.
    Jeff

    You can use tableColumn.setContextMenu (.) to install a ContextMenu in a TableColumn, or alternatively, the functionality you're after is also integrated with TableView by calling tableView.setTableMenuButtonVisible (true).

    -Jonathan

  • How can I use a context menu to change values in the numbers?

    I would use a context menu to view different values depending on whether you choose.

    example: projects

    sheet 1: projects, broken down by supplies, each of the deliveries was the price. I currently have this game to show me all the neede resources to complete everything, I want to implement in order to choose a pop up of a building of character, etc. and have it show me how it is necessary for this.

    HI Black Jack,

    I'm sure that many young people can do what you ask, but I do not understand your table - what data you want to move where and the place where.

    What would be in the context menu, where the popup would be and where the data would be displayed.

    Quinn

  • How can we add a new menu item in the file Menu?

    Hello

    I want to create the menu item on the file Menu, I want to create a new menu item, just after the item "save under...". ». Is this possible with SDK?

    Thanks in advance

    Farida kaid

    You can file a new menuitem in any "menu group" defined by the Illustrator. If you look at AIMenuGroups.h, you will find the names of various groups of menuitems. There are two that might be what you want: kSaveForMenuGroup & kSaveMenuGroup. I can't remember how much control you have within a group, but it would at least allow you to get close enough.

  • How can I disable the context menu the figure at the bottom of the screen when I drag the mouse on a document page?

    It's a gray rectangle with about 10 icons on it.  I prefer to use the menu and find the distracting pop-up.

    Hi dmodersk,

    Please click on the last option with an arrow at top on this gray rectangular box & she will get rooted in the toolbar instead of float down.

    Kind regards

    Nicos

  • How can I find the context menu for the adjustment brush

    I am trying to locate the drop-down list for the adjustment brush, not the Panel but the menu acutal who also has developed Adobe presets (as to soften the skin and whiten teeth for example).

    Click on the two small arrows:

  • How can I add PVC as my version control manager in Jdeveloper 11 g

    I'm always also have use 10g and 9i for different projects. Addition of the VC will be the same for all three?

    Currently using Serena PVCS version 8.2.1

    Thank you very much!

    PVC is not one of control tools integrating source JDeveloper.
    See: http://www.oracle.com/technology/products/jdev/collateral/papers/11/certification/index.html#Source_Control_Systems
    You can follow something like this to create a quick and dirty integration between the two:
    http://www.Oracle.com/technology/products/jdev/101/HOWTOs/extools/Subversion.html

  • How to add custom context menu menu items?

    How to add custom context menu menu items?

    through c++ sdk

    Hi Philippe,.

    to display a context menu you just replace the path of the menu. For example if you have a menu ' hand: & Layout: MyMenu "you can add it to the context menu"RtMouseLayout:MyMenu"in your MenuDef resource in the file en with the ActionID of your ActionComponent.

    Markus

  • How can I add a right click Menu mouse to click 'CANCEL' * and * "REDO" button to change the text in Firefox?

    How can I add a Menu with the right mouse button to display a "UNDO" AND "REDO" button to change the text back in Firefox without losing or forgetting the changes as I can under Google Chrome? -OMG I told dinnt - SORRY!

    Glad you stuck with this issue cuz I pulled a real boner trying to fix. I was totally distraught on the main menu of * two * UNDO and REDO. If you remember that I tried to install the menu shortcut for UNDO them and REDO and totally rejected the idea that they might be under Edit on the crazy Main Menu which of course, they have been and worked like a charm. THANKS again man, you are a true hero!

  • How can I add more shapes to my shapes menu pages?

    How can I add more shapes to my shapes menu pages?

    There is no provision for adding forms customized forms in the menu in Pages ' 09 v4.3 or in any version of v5 Pages.

    You can keep your forms customized in a separate document of the Pages and then paste them as needed in your present work.

    You can copy the form customized to the Clipboard and then choose in the menu file preview: new from the Clipboard. Now you can export this form in your favorite image format and re-use in the future efforts of Pages.

  • How can I add the "open a new tab" button back to tabs & bookmarks to the menu bar? I was able to click and drag the bookmarks there and the tab button has always been thr

    How can I add the "open a new tab" plus button back to tabs & bookmarks to the menu bar? I was able to click on and drag the bookmarks and folders containing the bookmarks in the menu bookmark to a bar of tools and click the tab + button was always on the right side of a tab before seeing ff 13.0.1 on windows 7.

    I need back, areas have red around em

    http://i48.Tinypic.com/25gue0x.jpg

    Draggin ' bookmarks toolbar items, it's done. Thank you for the mind can.

  • How can I add Hulu Plus for my media center menu?

    Windows media player

    How can I add Hulu Plus for my media center menu?

    Hello mjcraner,

    I suggest watching this thread, because it is similar to your request:
  • How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    This tutorial should do what you want. Use method 2.
    http://www.Vistax64.com/tutorials/105003-shutdown-options-start-menu.html

    Please read all notes caefully, not only the parts of the statement.

    t-4-2

  • How can I add a destination to the send menu to?

    How can I add a destination to the send menu to?

    Put a shortcut to the destination in the C:\Users\\AppData\Roaming\Microsoft\Windows\SendTo folder.

  • "Select" menu is missing from the CC of Photoshop options bar. How can I add?

    "Select" menu is missing from the CC of Photoshop options bar. How can I add?

    Hi CsapodyM,

    What exact version of Photoshop are you using? (Help > about Photoshop)

    Post a screenshot of your Photoshop window.

    Kind regards

    Assani

Maybe you are looking for