Cannot listen to mouse click or action in the Menu?

I have a Menu inside a menu without MenuItems bar, and I am unable to set the Action for what he... I tried these approaches without success
mnu.setOnAction
mnu.addEventHandler(MouseEvent
Impossible to use
mnu.showingProperty().addListener(new ChangeListener 
as this Menu has no MenuItem


Any ideas?

Hello. The menu control works as expected.
If the menu does not contain menu items, you can use Menu.setGraphic (node);

 public void start(Stage primaryStage) {

        MenuBar menuBar = new MenuBar();

        Text hp = new Text("File");
        hp.setFill(Color.WHITE);
        Menu menu1 = new Menu();
        menu1.setGraphic(hp);

        hp.setOnMouseClicked(new EventHandler() {
            @Override
            public void handle(MouseEvent event) {
                System.out.println("Menu clicked");
            }
        });

        final Menu menu2 = new Menu("Options");
        final Menu menu3 = new Menu("Help");
        menuBar.getMenus().addAll(menu1, menu2, menu3);

        StackPane root = new StackPane();
        root.getChildren().add(menuBar);

        Scene scene = new Scene(root, 300, 250);

        primaryStage.setScene(scene);
        primaryStage.show();
    }

Or you can use a toolbar instead of a menu bar:

        ToolBar toolBar = new ToolBar() ;
        final Button menu1 = new Button("File");
        final Button menu2 = new Button("Options");
        final Button menu3 = new Button("Help");
        toolBar.getItems().addAll(menu1, menu2, menu3);

Tags: Java

Similar Questions

  • I can't use the font... "If I write their name it works but does not work by clicking on it in the menu of the tent"

    I update the new version cs (2015) after that I can't use the font by clicking on thema by the menu' bar

    How do I do?

    See this message thread. I think it has the answer:

    Cannot access fonts with InDesign CC 2015

  • When I right click on my desktop the menu comes from half in another language

    When I right click on my desktop, the menu comes half in another language.  Any thoughts on how to fix it?

    Original title: Office properties?

    If you do not know the language overall is English or any other language, you can try this:

    Go and account administrator, go to the following location and delete the file FNTCACHE. DAT:

    C:\Windows\System32

    Then, restart the PC and check.

  • My panels are not displayed when I click on it in the menu drop-down windows. The box appears but not the Panel. Can anyone help?

    My panels are not displayed when I click on it in the menu drop-down windows. The box appears but not the Panel. Can anyone help?

    Try to reset your preferences using Cmd (LTRC) - Opt (Alt) - move when restart you the version of AI. Did you once two monitors?

  • Mac Pro end of 2013 will not launch apps. most mouse clicks are delayed to the point of making it unusable.

    Hello community,

    I have a problem with my Mac Pro end 2013. I bought it in August of 2014. It has always seemed to be a little weird, but I attributed this to the usual first generation bugs and not-so-stellar OSXs from the end. When it was available, I installed the latest update of El Capitan, 10.11.5,, and it seemed that Apple had finally deceived. Since the update, I enjoyed the use of my MP as much as other Macs I've owned over the years (a Performa, G3, G4, G5, several iMac, MacBook, MacBook Pro and Mac Mini - 14 in all).

    Yes, computer on my MP was nearlly nirvana, that is, until a few days ago. It started when my mouse became very unresponsive and I just thought he needed a couple of new batteries. I put fresh packaging as engergizers in, but it did not help. The slider was slow and jerky, and sometimes it is completely frozen. I paired a new mouse, also with new batteries, the Member and experienced the same thing. Basically, the mouse was unusable. The slider control would come and go at random. I do not think that to restart faster, (which surprises me, because, in the past, I had to do quite often to operate properly). But I restart, and it seemed to clear up the problem at the moment. This strange mouse behavior happened at least a dozen times since the beginning, but generally, it did not last long and lightens without rebooting. I noticed that often happens during Time Machine backups are in progress, or when another CPU-intense activity is happening.

    Unfortunately, it seems that this problem of mouse was a harbinger of things to come. Today, I started the MP of his sleep and clicked on Mail. Nothing happened. It confused me and left me puzzled for a while. I clicked on my browser, Google Chrome, and even once, nothing happened. I thought I should go in my applications folder and try to launch Mail from there to see if that would work. All the time that I did, I got a message window that says: "Cannot open the application"Mail.app"because it may be damaged or incomplete." Immediately after you read this, another window message, just like this one open and said the same thing for Google Chrome - "Unable to open," etc. Icons for Mail and Google Chrome in the doc are now passed to the application icon generic Apple, (the white sheet with the 'A' in the lower corner). Each application I click on since waking from sleep today gives me the same result. Nothing opens the application icon in the dock or the original file in the applications folder. Another very strange thing, it's clicking on a file opens the file in the application it is native. Strange, Yes, but I was able to open Google Chrome, clicking on a saved URL, and I open TextEdit by clicking on a saved TextEdit document. But the application does not open by clicking on its icon. I thought it was very unusual.

    With this weird behavior also come a slowdown in response time of the mouse and keyboard. It is so slow that it makes the work on the machine, for all practical purposes, impossible. It takes 20 or 30 seconds to register a click. But, adding to the quirkiness of everything that happens, once an application is open, like TextEdit, the mouse and the app seem to work almost as if nothing was when working within the App on the other hand, the responses to the mouse by trying to use the finder or open a file from the desktop are very slow. A note on this: when I first the computer woke up today and ran into problems, I tried to open the applications folder and when it finally opened, there is no list of applications. In near-panic mode, I immediately tried the folder my documents to see if my personal files were intact, but no they had also disappeared, or so it appeared. I discovered later, having left the files open on my desk for an hour or two, that files showed later upward. It was a great relief. But the icons on several applications from the applications folder had changed to the generic Apple icon, for some reason any. I rebooted into Recovery Mode, but he wasn't able to do anything there except performing first aid on the hard drive, which showed everything be ok. I didn't restore from a backup at this stage. I had another option to try everything first. Re-boot after that nothing changed.

    The option I mentioned was to try Disk Warrior on it. I ran the latest version and rebuilt on the hard drive, checked the material, and all that makes the software, I forgot. It took about 45 minutes to run. The result was that it showed some things which have been corrected, probably 8 or 10 items, any rang critics. I said a short prayer and restarted. Nothing has changed. Everything that I described before was exactly the same.

    Exasperated, I came here to see if it was what I could glean conversations that could help me. I have not found something really substantial to help me solve the problem, unfortunately. What I found was that I'm certainly not the only person who has experienced problems of 2013 end MP of catastrophic proportions. It is obvious that there is a serious problem with this Mac.

    For those who have had smooth sailing with them, be very happy. If I was. The question came out of the blue. Yesterday, I would have been there with you praise. I hope your luck tends and you never have to experience this level of frustration with a product. I mention this because some seem to dismiss the issue as flukey. But I must say, in all honesty, anyone denying the MP has a problem either whistling through the graveyard or they are so pro-Mac that they are not prepared to allow even a small flaw in the Apple armor. They are good people, but they are in denial. I know how easy it is to refuse to acknowledge the existence of even a slight stain on the first brand hand. I have fought wars of Mac - PC at the time where we didn't know what a Mac - but almost every designer in the country. We labeled Mac users quietly the balls also odd, unconventional and offbeat. But we knew we had the best product. We knew that when the rubber meets the road, in particular regarding graphics, we would spank a PC each time. The years 90, and even the first part of the century was a time when serious computer users aligned on one side of the road or the other, Mac or PC. A lot of animosity arose between the two camps, especially on the side of the Mac, because we were the underdogs, rather despised by the majority. We felt the need constantly to get our message to the number overwhelming dominate the PC users. It follows a sort of tacit animosity. And it became a proposal for a war similar to many Mac users, myself included. For people who lived in that time and have subsequently become more and more immersed in all things Mac, the war is raging on. This is the meaning behind my description of those who are "so pro-Mac". Again, it is easy to understand why this mentality still exists. It was not easy for us guys good back in the day. But it is now time for rational people watch mentality 'til-death-us-part and face the facts, which also means recognition of all prejudice deeply seated, illogical. This member is not good. There is a real possibility that it could be much worse than not well. Time will tell.

    On the side of those who are unwilling to admit there are problems, of course, the argument will be, given all the members sold, he's going to be a dud or two, it's just human nature to be less - than perfect. I accept that. For my money, however, after having lived what I have with my Congressman and to hear the facts given on this site by several owners of the MP - and the absurdity of the incredible problems they have known - that any rational thinker must know at least the idea that means that we deal with a lot more here than the occasional, inevitable dud.

    The bottom line is, my problems are not isolated. It is clear that Apple has a product that fails to a very rare rhythm of the brand. Once again, I have owned for a decade of Mac, all shapes and sizes, but I've never had anything that happens to one of them that comes close to this type of failure. How disappointing it is to me, who has worn the coat for Apple products for nearly 30 years.

    I doubt if there is something that everyone in the team of technical advisors here at the Community Board of Apple can do to help me with this problem. I'm not somehow devaluing at your service for Mac users. I certainly welcome any help you can offer. I know you have helped countless others to find solutions to the problems. But it's a little different for you now with this model of MP. Your best efforts seem to be a bit anemic on this topic. And it's not your fault. Apple isn't talking, then you are here on an island of yours, grasp at straws to try to help. I congratulate you on that, but nothing I've read has shed significant light on this which seems to be a mess of real, first Apple class - currently without a viable solution.

    Yet once again, I welcome any suggestions and thank you in advance to address even. I will definitely check here in the coming days to see if he has the answers.

    In my view, the prudent thing for me to do now is to make an appointment at my nearest store from Apple, an hour and a half and let them begin to set. I'm not too optimistic about a full success to resolve the issue during the first visit, based on the experiences of other contributors. And I rejoice in water and the lift back repeatedly to do things, as seems to be the rule rather than the exception. But in this regard, fortunately, I'm retired and now do occasional projects at low pressure. It's great to not have the MP to put food on the table like I did for many years using my trusty ol ' G5. I don't know what I would if I still ran my business full-time and depends on this MP. Small businesses rely on their equipment to work. The major failures, such as this MP seems to display with regularity can quickly put a small company out of business. This failure is not a walk in the park for me, but I really feel for those who invested heavily and who depend on every day, only to have this mucking things up, i.e., when it is not in the repair shop.

    Finally, I write my thoughts here to express my disappointment in commiseration with other owners of MP end 2013. These are users who were as delighted as I when Apple eventually replaced the G5 with this elegant, state-of-the-art piece of equipment. Like many others, I jumped directly into the train without reservation, and I paid their price without any reluctance. Plunking down to $4 k for it, adding on 27 "display Apple and then having to buy an external drive now makes me a feel a bit embarrassed, at best and, at worst, as an easy mark. The result is, I wasn't expecting this new MP to throw myself into a sort of computer euphoria, I expected just to work as it was announced. The only thing I added on and I thank God, I did it, was AppleCare. Before this saga is over, Apple will probably want that I had refused it.

    I have not read all what you posted but I think a clean installation, even to an external and test simply install would probably tell a different story. I think you did an installation "backup" probably from a backup of TC. I also think that Legacy Applications from a backup OS x and third-party would be not beneficial. Try it, see what improves.

  • Near VI if the mouse click occurs outside of the VI

    I want one my VI to automatically close if the user clicks the mouse outside of it (and not within Control Panel).  This behavior is possible?

    If you are a family with the window API/SDK.  Toolbox G can have lets you capture the mouse click event outside the window of LabVIEW (using the window APIs).

    If the survey doesn't bother you, there is an easy approach (see picture):

  • want to make action on the menu (on the program)

    Hey guys what's up

    I am doing an action in the application menu, I did the action and took the title, but I don't know where to implement what happens if the action is triggered, I looked in the documntaions on the blackberry site and have not found what I was looking for, the idea is once the user clicks or triggers the action a new page with a close button in the title bar will display, the page will contain information about the app purpsoses and my name etc... It is therefore an information page

    Here's the code, I have implemented the action in the tabbedPane so that it can be accesed through the program, and thanks a lot guys

    import bb.cascades 1.2

    TabbedPane {}
    ID: mainTab
    showTabsOnActionBar: false
    Menu.Definition: MenuDefinition {}
    actions:]
    {ActionItem}
    Title: 'about '.
    onTriggered: {}

    }
    }
    ]
    }

    Tab {}
    Title: 'test1 '.
    delegate: delegate {}
    Source: "asset:///msaaTab.qml".
    }
    delegateActivationPolicy: delegateActivationPolicy.Default
    }

    Tab {}
    Title: 'test2 '.
    delegate: delegate {}
    Source: "asset:///sbaahTab.qml".
    }
    delegateActivationPolicy: delegateActivationPolicy.Default
    }
    }

    See here: https://developer.blackberry.com/native/reference/cascades/bb__cascades__sheet.html

  • DO A RIGHT CLICK ANY ITEM IN THE MENU START. ONLY GET PROPERTIES THAT OPENS THE PROPERTIES 'TASKBAR '.

    This change has occurred in the last 30 days, but when I open the Start Menu I can are more done right click anything and get the 'Normal' list drop-down all appear is a box and she's 'Properties' and you open the properties of the task bar.

    Any ideas on how to fix - because I was not smart enough to run the restore when it appeared first, didn't want to try running through 15 or more of them.

    WIN VISTA HOME PREMIUM SP2 32-BIT

    Hello

    You had recently installed the software?

    Have you tried a system restore to the date and time before the problem occurred?

    Restart and start typing the F8 key

    Select Mode safe mode with networking

    Download the following and run a full scan to exclude the malware

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    When you are done, reboot and let Windows load

    Start > type CMD

    Right click on CMD and select run as administrator

    Type Sfc/scannow

    Press enter

    Note: There is a space between sfc and / scannow

    Use the System File Checker tool to repair missing or corrupted system files

    http://support.Microsoft.com/kb/929833/en-us

    The scan only takes a few minutes

    Open the taskbar and properties of the Start Menu by clicking on the Start button, clicking Control Panel, appearance and personalization, and then clicking the taskbar and Start Menu.

    Click the Start Menu tab, and then click Customize.

    In the Customize Start Menu dialog box, click on use default settings and then click OK.

  • Cannot set a video loop of background for the menu

    It cannot be that difficult to do.  I have damage animations.  Buttons work fine.  I can not put a video loop behind the menu.

    I tried:

    (a) alt + drag the .mp4 on the menu

    (b) using the icon for selecting the video option in the control panel menu for .mp4 loop property

    (c) by using a single video file to point to animate on for 2 seconds then set a loop after that for 27 seconds of video loop

    Option C preview correctly and all, but just showed as a black background in the final exported .flv

    Option A and B just did nothing.  There is no video vignette that appears, or whatever it is.

    The loop in the audio file works fine in the preview and the final result, but not video.

    I've looked through many tutorials and just may not know what I am doing wrong.  Any suggestion would be appreciated.

    Thank you

    Should work.

    I would try the elementary streams: m4v and audio.

    Are you sure there are no other layer interfering with the motion? For example, adding a still in photoshop without making the 'context' works fine until you add a background of movement. Yet to replace the technical background layer, but luckily leaves your extra layer covering the motion. Probably not in this case as one of your options produces motion.

    What do you mean by video thumbnails? You're adding motion to the mp4 and also animate buttons?

    If it does not, use any closure and just get the movement of work.

    Test your basic bringing in a motion menu and using the m4v that to see if can get motion.

    What is your default transcoding defined on your 1280 x 720?

  • My refuses to mouse click until I opened the task manager - what could be the cause?

    I installed Windows 7 pro on my laptop (64 bit) and for some reason, when I start the computer, on which the mouse will be able to move, but can't select anything or click. When I fly over things that should light up, nothing seems to happen. I have similar issues - when I open the Task Manager, the mouse begins to click. In fact, when I press Ctrl + Alt + Delete and with the pointer of the mouse on "Start Task Manager" I can see the mouse commit but I don't know what process is engaged to achieve. I can also drag files in folders or use the scroll wheel with my mouse. I use a Lenovo laptop on a dock with a keyboard and a Microsoft wireless mouse. I seem to be able to drag the files when I'm not on the dock. Anyone have any ideas? Thanks in advance!

    Hi OpenPro32


    1. What is the mouse model number?
    2. during how long have you had this problem?


    Method 1:

    You can use the hardware and troubleshooting of devices and check if it lists and help solve the problems of any.
    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter


    Method 2:
    You can also look at the link below and check if the steps provided assist solve you-

    http://support.Microsoft.com/kb/838398

     

    I hope this helps.

  • Right click on Favorites gives the menu grayed out in 29 FF...?

    Hey,.

    Since my upgrade to Firefox 29, when I right-click on any bookmark in my list of bookmarks, I get the context menu, as always, but ALL options are grayed out so that I can not click on any of them? How can I fix it?

    I had the same problem today. I closed and reopened firefox and now all the choices ("open in a new tab", "open in a new window", etc. are available again.

  • How to make fuss when I click on it in the menu bar? My story just shows a day and folders of bookmarks.

    What appears when I click on history is a window that displays a folder for history and a folder of bookmarks. In the file history is only the current tablets which are open, that's all. The other folder is favorite, and it shows subfolders for all bookmarks, each of them. The prior full display recently disappeared, a week or two ago.

    It's normal.

    Bookmarks and history have different objectives and each have their own entries menu, but both are stored in the same database places.sqlite file and managed in the bookmarks/history combined Manager (library)

  • DVD autorun.exe opens main html.menu very well, but when click on hyperlink in the menu it opens the new tab, but does not play a video, but the video html works directely

    Autorun.exe DVD opens with main menu.html. then when I click 1. HTML which is ment to start (from the main menu.html) only to open a white page only and plays not the file using src = flvplayer.swf player flash video. (it works on all other browsers) fine. Installed the flash plugin but still does not not in Fire fox. But when I navigate to the root of the cd and click 1. HTML it opens and plays very well, but do does not form the main menu.html. any help would be grat

    Thank you

    In your main.html:

    • What is the URL in the address bar?
    • What is the URL of the link?
  • Cannot move addons; not appearing is not in the menu toolbar Customize

    I want to spend my addon icons and others for some of my extensions (forecast Fox, Webmail Notifier), but they are locked on my menu bar or do not simply appear. When I go to customize toolbar screen, addons in question are not to be selected and refuse to be moved from their current positions to a better place.

    How can I change their locations, so I don't have to hit Alt just to see the forecast?

    When you try to move the display of forecast Fox toolbar, you should be viewing this page - http://www.getforecastfox.com/customize/16/

    This page automatically opens when you click the Options button for the extension in the Extensions tab Add-ons Manager in versions of Firefox 4 +. It's the only extension I've ever seen in this way, makes the preferences.

  • How can I quickly drop the same item without having to click through all of the menu by clicking right, again?

    Is it possible to somehow expedite deleting items without having to click the entire menu everytime?

    three simple methods

    -Drip quick (ctrl + space)

    -First element of copy and paste...

    -Select the first item and then hold down the ctrl key to drag a copy of it

Maybe you are looking for