The right click detection

Hi again, Im trying to get an event on right click, but I can't work...
I also did not find anything with the Research Council of events secondary mousebutton

Here is my idea:
I got a list of items and I want to detect a right-click on each element event.

IM waiting for that (event.isSecondaryButtonDown ()) is not the right choice, but I've already tried
a lot of different things with no results.

    for (int j = 0; j < playground.size(); j++)
    {
      final int x = j;
      
      playground.get(j).setOnMouseClicked(new EventHandler<MouseEvent>()
      {
        public void handle(MouseEvent event)
        {
          
          if (event.isSecondaryButtonDown())
          {
            System.out.println("got it");
          }
        }

      });
    }
Thanks for the help,
Martin

It is a great thing that is weird and seems to be something wrong with swing or something like that. Before analyzing the problem, you can use

if(event.getButton()==MouseButton.SECONDARY)

Instead of isSecondaryButtonDown() which I think is the standard way, because if the mouse is "clicked" I understand that at the time when the event is dispatched, the button is not pressed.

The strangest thing is:

(a) If you are creating elements inside a stadium of the isSecondaryButtonDown is always false
(b) If you are creating a scene and a scene but include you this scene inside a JFXPanel and within a framework of the method returns true, perhaps because there is something different between swing and javafx mouseEvent dispatching

Published by: anderruiz on July 28, 2011 03:53

Tags: Java

Similar Questions

  • Where is the bookmark option passed from the right click of the mouse in the Bookmarks panel?

    I used to be able to right click on the bookmarks bar and sort bookmarks in alphabetical order, which seems to be missing in the right click menu in the 3. XX versions

    You will see that the element "sort by name" in the context menu if you right-click on a folder and not if you right-click an individual bookmark.

  • Long left clicking displays the right click menu

    When I press and hold the left mouse button, the right-click menu is displayed.
    I want to turn this feature off, but can't remember which extension it controls or if the function is built into Firefox.

    Hooray! Found! Thank you Google.

    I found an old - very old - thread on Mozillazine.org:

    http://forums.mozillazine.org/viewtopic.php?f=38 & t = 340572

    And it IS a normal feature of Firefox, but it is normally OFF.

    I think I need to have recently turned it on after reading an article of "Tips and tricks of Firefox" somewhere.

    In any case, the preference is called 'ui.click_hold_context_menus '.

    And I just remembered that I added it in my preferences file "user.js", among a load of others:

    /*

    *   Disable the Delay When Installing New Extensions
    */
    

    user_pref ("security.dialog_enable_delay", 0);
    /*

    *   To turn off the URL greying
    */
    

    user_pref ("browser.urlbar.formatting.enabled", false);
    /*

    *   To unhide the "http" portion of a URL
    */
    

    user_pref ("browser.urlbar.trimURLs", false);
    /*

    *   Enable spell checker in multi-line text boxes & single-line text boxes
    */
    

    user_pref ("layout.spellcheckDefault", 2);
    /*

    *   Double underline style
    */
    

    user_pref ("ui. SpellCheckerUnderlineStyle «(, 4);
    /*

    *   Cycle through open tabs with Ctrl+Tab
    */
    

    user_pref ("browser.ctrlTab.previews", false);
    /*

    *   Disable Animations for Full Screen
    */
    

    user_pref ("browser.fullscreen.animateUp", 0);
    /*

    *   Click and hold on a hyperlink to show the context menu
    */
    

    user_pref ("ui.click_hold_context_menus", true);
    /*

    *   Instant Apply Preferences Without Closing Options Window
    */
    

    user_pref ("browser.preferences.instantApply", true);
    /*

    *   Middle-click in any textfield, addressbar or searchbox to paste clipboard
    */
    

    user_pref ("middlemouse.paste", true);

    So there's a lesson here: do not add too many settings to your preferences of Firefox at the same time or you may forget what you were doing!

    Thank you, all. I will now mark this as "resolved".

  • do not click on the menu that appears when I right-click my taskbar, such as the right click menu disappears when I move the mouse the right click menu

    PROBLEM: CONTEXT MENU DISAPPEARS WHEN YOU TRY ON THE LEFT, CLICK AN OPTION

    Hello
    I'm using Windows 7, and I could always
    go to my taskbar and right click
    Icons and active icons, bring to the top
    the list on the right click on the standard Menu.

    PROBLEM
    As soon as I moved my mouse away from
    the background of windows 7 taskbar to go a couple
    millimetres above on the left, click an option in
    I opened with my right click context Menu
    The whole Menu disappears, and it happens in
    Firefox version 29.01, other programs in Firefox,
    and others such as Skype.
    When I was running Firefox 28
    I didn't have this problem, can you help out me.
    Thank you
    Kev Borg

    PROBLEM
    MAKE ONE CLICK RIGHT MENU DISAPPEARS WHEN YOU MOVE YOUR MOUSE TO THE LEFT, CLICK ON A MENU OPTION IN THE RIGHT CLICK MENU.

    'YOU can not because WHEN YOU MOVE YOUR MOUSE TO THE MENU YOU JUST a RIGHT CLIC ON OPEN DISAPPEARS before you HAVE a CHANCE TO CLICK LEFT of YOUR CHOICE. "

    SOLUTION
    [ 1] GO TO control PANEL AND click HERE FOR the VIEW MENU
    [ 2] GO to "EASE of ACCESS CENTER" AT the TOP.
    [ 3] LEFT CLICK ON the MENU ITEM "theEASE of ACCESS CENTER.
    [ 4] AFTER YOU are a LEFT CLICK ON 'EASE of ACCESS CENTER' seems.
    [ 5] LOOK down THE LIST UNTIL YOU FIND to "MAKE THE MOUSE EASIER to USE".
    [ 5] THE UPPER SHOWS YOU HOW to CHANGE YOUR MOUSE COLORS ETC.
    [ 6] SCROLL DOWN UNTIL YOU SEE THIS TOPIC "MAKE IT EASIER to MANAGE WINDOWS".
    [ 7] UNDER this MENU, there is check.
    "ACTIVATE a WINDOW BY HOVERING over IT WITH YOUR MOUSE"

    [8] ARE OF COURSE IS NOT A CHECK MARK IN THIS BOX TO OPTION, IS THERE A CHECK IT AND APPLY AND CLICK OK TO SAVE.

    And now, you should have no more problems with your right click Menu disappears when you move your mouse over the menu left click on a menu item on a right click menu.

    SOLUTION SOLVES THE PROBLEM.

    Thank you and I hope this answer help all the other people who have had this frustrating problem.

    was soon KiwiKev

  • Using firefox 14.0.1. Load a link using the right click and "Open link in new window", translates into a new window opens but doesn't show URL address bar...

    Using firefox 14.0.1. Load a link using the right click and "Open link in new window", translates into a new window opens but doesn't show URL address bar. However, if I click with the right button on a link and select "Open link in a new tab", the tab displays the URL in the address bar. If it works when a new tab it's not in a new window.

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • I was on facebook and remove an icon by using the right-click menu, but then all my photos and pictures of profile, could no longer be seen. I was able to view them in the browser, so it's something I've done in Firefox. How can I unlock a site? "

    I was on facebook and remove an icon by using the right-click menu, but then all my photos and pictures of profile, could no longer be seen. I was able to view them in the browser, so it's something I've done in Firefox. How can I unlock a site?

    If you select that right click menu context then you block all images from this area and not a specific image, so do not use that.

    • Check exceptions in tools > Options > content: Load Images > Exceptions (for example sphotos.ak.fbcdn.net)

    You can use the following steps to check if the images are blocked:

    • Click on the "More information" button to open the "Page Info" with the Security tab selected (also accessible via "tools > Page Info").
    • Go to the Media of the window tab "tools > Page Info.
    • Select the first link of the image and scroll down through the list with the arrow down.
    • If an image in the list is grayed out and there is a check mark in the box "block Images of..." and remove this mark to unlock the images from this area.
  • I can't use the right-click in the windows Explorer window

    I use windows 8.1, hp pavilion touchsmart nb x 64. my windows explorer suddenly went wrong. I can't use the right click.
    Please help me, I can't access my data

    Hello

    Try running windows System Restore - choose a restore point at least 24 hours before the occurrence of the problem with the context menu.

    A guide on the implementation of this can be found on the following link.

    http://pcsupport.about.com/od/Windows-8/FL/system-restore-Windows-8.htm

    Kind regards

    DP - K

  • Is it possible to customize the right-click menu?

    I use FF4 RC2 and I wonder if it is possible to customize the context menu? In FF3 if you right click on a tab lists ' new tab '. Reload tab reload all tabs... "etc. but in FF4 if you right click on a tab lists only "Reload Tab | PIN as App Tab... "etc.

    I really really use the right click-> new tab in FF3 A LOT! It was a HUGE disappointment for me when I started using FF4. Is there anyway that I could add the button tab in the right click menu?

    Thanks in advance!

    Not that I know of. You can use file > new tab or Firefox > tab in addition to what I posted above.

    Maybe an extension like Tab Mix Plus can add this feature in the context menu of the Tab bar.

  • Re: The right click of the mouse does not work on the Satellite L450 - 18 d

    My laptop is about 2-3 months and today just as the right click button stopped working completely.
    I did a system restore with still no luck.

    Any ideas?

    > the right click button completely stopped working. I did a system restore with still no luck. Any ideas?

    It can be hardware junk... Perform a recovery with a recovery disk procedure to make sure that is not os/driver associated. Otherwise, contact the service centre in your country, it will fix it for free under warranty

  • Mail question - how to remove something in the right click options

    I find that I sometimes wrongly empty my deleted folder.  I got in the mail list and think I select "delete spam" when in fact I chose "delete deleted items".  Is there a way to delete 'Clear cut' in the right click menu in the mail.  I searched the internet and can't seem to find the answer.

    It's not a way to remove it.

    You can simply use the shortcut to empty the junk mail (cmd-Opt-j) or set up preferences of Mail to delete spam after a period of time.

  • How can I change the "right click" menu for a table control?

    Hello

    How can I change the "right-click menu" of a table control. I would like to be able to remove the ability to add or remove columns and maybe more selections. I want to keep the possibility of

    Add or remove lines

    Right-click on your table.  Then go to advanced-> DURATION Shortcut Menu-> Edit.

  • Disable the right click Menu of the WebBrowser

    Hi all

    I use a WebBrowser control to display a Test report in XML format.  The problem I have is that right-clicking on WebBrowser displays a context menu.  Anyone know how to remove the right click menu option?  If not does anyone know a method to display XML files using an indicator that does not include a right click menu?

    I've tried to filter the clicks right on WebBrowser, as shown, but this seems to need the delay of 500ms (?) to work on my machine of dev of LV and is not reliable when my application is integrated in an EXE and deployed in a LV Run Time System.

    Concerning

    Steve

    Hi SercoSteveB,

    Because the WebBrowser of LabVIEW control uses Internet Explorer. The best way to disable the contextual framework

    menu is disable in fact from the Internet Explorer itself. I think that your default browser is not Internet Explorer,

    It is therefore prudent to disable right click here.

    Here is the manual that explains how do:

    Activate or deactivate the contextual menus right click in Windows Explorer

    http://www.thewindowsclub.com/enable-disable-right-click-context-menus-Windows-Explorer

    I hope that helps!

    Kind regards

  • The right click "rotation" clock or function in a clockwise direction counter on my images does not work

    The right click "rotation" clock or function in a clockwise direction counter on my images does not work
    There is a range of adjustment that may be messed up?

    You are under Win XP and the display of photos with Windows Picture and Fax Viewer?

    Explain what you mean when you say "does not" you receive an error?

    The following command will force a reinstall of Windows Picture and Fax Viewer and can be worth a try:

    Reach... Start / run... and type
    (or copy and paste):

    regsvr32 /i shimgvw.dll

    (Yes, the space after the 2 and the)
    After the i is necessary)

    Press on... Come in...

    You should see a dialog box stating:
    DllRegisterServer and DllInstall in successful shimgvw.dll

  • New shortcut text missing in the right click option...

    Hello

    I have problem in windows 7 the new option of text document in the right click menu is missing...
    PLS HELP ME...

    Ensure that this key exists HKEY_CLASSES_ROOT\.txt\ShellNew\NullFile

    If it does not exist, create it. Just right click in the right pane of the C:\windows\shellnew key,
    and select New/String value, and then type: NullFile

  • How can I change the appearance of the right click Menu

    I am running: Windows 7 Home Premium 64 Bit

    I was messing around in the control panel and I changed a setting that has changed the right click menu and how it comes on the screen. Now when I right click on it slide in but before she fainted at now I cannot change back and can not find the option for her

    I think this is where the control panel: System and security-> system: System Settings Advanced-> then watch while Visual effects.

Maybe you are looking for

  • I get BSOD with the key USB TV Tuner PX1211E-1TVD

    Hi all I just bought the model tuner TV USB Toshiba px1211e-1tvd and whenever I turn it on I get a blue screen error on my hp Pavilion dv6821el pc... dv6000 series. I tried to update the BIOS and the driver of my pc's display, but without results...

  • HP pavilion dv2000 key board does not

    Hai HP pavilion dv2000 key board does not. I have activated the key online Board that also does not work. because my hp utility cd has been damaged, I changed my OS to windows 7 key board ultimate .the rest is notworking .then I used a USB key Board

  • loss of connection WiFi

    Hello! I have a mac book pro 13 inch with piece of retina it a month or two ago, processor: 2.9 GHz Intel Core i5 memory: DDR3 6 GB MHz 1867 chart: running intel Iris Graphics 6100 1536 MB OS X 10.11.3 and I have tried to download league of legends (

  • Y40 charger plugged in but not charging

    I've recently had problems with my battery display is stuck at certain percentages and display incorrect percentages. I then updated for Windows 10 of 8.1 and now when I have the charger is connected to the laptop detects it, but it says that it does

  • Channels not defined in Combo Box Bug?

    I found a problem with the drop-down list box control: 1. create a drop-down list box and deselect 'allow Undefined Strings. 2. run the VI 3. Select a list box item 4. press on the BACKSPACE key to remove a few letters of the item 5. click on on the