Howto make a KeyCombination with a Shortcut Modifier?

Maybe I'm missing something really obvious but I can't seem to define a keycombination using the platform-independent shortcut modifier. According to http://docs.oracle.com/javafx/2.0/api/javafx/scene/input/KeyCombination.html the following should work:
menuItem.setAccelerator(KeyCombination.keyCombination("Shortcut+C"));...but it doesn't. This actually puts 'Shortcut + C' in the menu item (hardly ideal) and it doesn't work on Win7. I also tried:
menuItem.setAccelerator(new KeyCodeCombination(KeyCode.C, KeyCombination.SHORTCUT_ANY));...same problem.
How can I specify a platform-independent keycode combination, ideally as a string so it that it can be shunted off to a preferences file?
Thanks

I'm not sure what you mean. I can press Alt+F and the file menu opens fine. Tested on Windows 7 with JavaFX 2.1b18.
package hs.javafx;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class MenuTest extends Application {
  @Override
  public void start(Stage primaryStage) {
    MenuBar menuBar = new MenuBar();
    menuBar.getMenus().add(new Menu("_File") {{
      setMnemonicParsing(true);
      getItems().add(new MenuItem("Open..."));
    BorderPane borderPane = new BorderPane();
    borderPane.setTop(menuBar);
    primaryStage.setScene(new Scene(borderPane, 300, 250));
    primaryStage.show();
  public static void main(String[] args) {
    Application.launch(MenuTest.class, args);
}

Similar Messages

  • HT201236 how do you make a bullet with keyboard shortcuts?

    how do you make a bullet with keyboard shortcuts?

    According to this https://discussions.apple.com/thread/1381905?start=0&tstart=0 Option 8 will insert a bullet.

  • HowTo make a servlet with PDF output to the browser

    A new one goes here !
    How do I make a Servlet which functions like the rwservlet, and pushes a PDF output to the clientbrowser ?
    Is there any sample code that uses rwclient or others to produce a response ?
    Thanks anyone.

    Requests to the ReportsServer to run a job and return PDF is simply submitting a URL. You could easily write a servlet to submit a URL and stream the results back to the browser. However, this is a more generic requirement not really involving Reports (apart from the fact that you're calling it via the URL).
    For more information on creating a servlet to submit a URL and get the results, you might like to cross-post to the JDeveloper forum.

  • [svn] 4706: When handling the damageEvent make sure _contents gets updated with the potentially modified contents of the textFlow .

    Revision: 4706
    Author: [email protected]
    Date: 2009-01-28 07:58:30 -0800 (Wed, 28 Jan 2009)
    Log Message:
    When handling the damageEvent make sure _contents gets updated with the potentially modified contents of the textFlow. Either the contents or the style of the text flow, or both could have triggered the damage event.
    QE Notes:
    Doc Notes:
    Bugs: SDK-18749
    Reviewers: Gordon
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18749
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • I want to make the keyboards numerical keys shortcuts for buttons.

    I want to make the keyboards numerical keys shortcuts for buttons, without a modifier key is this possible ? e.g. press '1' on the keyboard button 1 is pressed on the GUI.

    The number keys are not valid hot keys for our controls. The easiest workaround would be to use fhe F keys instead (F1 for button 1, etc.) However, if you are set on the number keys you could implement this with a panel callback. You could have a panel callback that monitors all keypress events and then, depending on the key pressed, calls the code that would be called with a button press of the button for that key.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Is there any way to make 'stroke path' a keyboard shortcut in photoshop cs6?

    because it would make things easier.
    It's a right click command when using the pen tool and instead of doing that every. single. time...
    it would be easier to just make a keyboard short cut but im not sure how to assign shortcuts to right click commands. is this possible?

    Thank you so much for this info. I jumped online to see if I could stroke path without the confirmation box coming up every time this does help but having to make the path with pen tool, then switch to brush with B then hit enter to stroke, then back to pen with P. Guess its about as good as I will get. I have two buttons on my intous 3 pen. i had one for stroke path and one for delete path, but it was asking to to confirm pen pressure every time. Thanks very much!!

  • Make an offset with a variable

    Hi all,
    In query designer, I want to make an offset with a variable, i explain :
    Now, I modify my date manually. for example, i give in selection screen month and year, 05.2008 and i change this date in 04.2008 with a "-1" offset.
    I want to give the possibility to make in the selection screen one numeric field which change automatically the offset :
    date : 04.2008
    offset : -2
    => date = 02.2008.
    Can i do this we a variable?
    Another way is to ask a second date. (date1, date2) but i prefer make this with an offset.
    I can find anything to do this.
    Can you help me?
    Thanks,
    Adrien

    Hi,
    you can do this with a customer exit variable. Have a look at the [SAP help |http://help.sap.com/saphelp_erp2004/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm] on this subject. Basically what you would be doing is programming in Step 2 after the user has entered the value for variable 1.
    Hope this helps.
    Svenja

  • How to type shortcut modifier icons?

    I'm making a handout for students and want to know what keystroke combination will produce the shortcut modifier keys for Shift, Control, Option and Command.
    Thank You

    baltwo wrote:
    The 10.5.5->10.5.6 is a delta update. The COMBO takes every earlier version 10.5.+ to 10.5.6. Very strange stuff you have going on with your machines. I can't explain why you have the issue.
    As I noted, after applying the combo update to my other MBP, nothing changed.
    However, as you see I can enter those characters. I was simply using the wrong font set.
    I entered those characters last night on this MBP, which still has only the delta update applied.

    See? Works like a champ. Nothing to do with the update.
    ⌧⎈♕✬
    usw, usw.
    As Shakespeare noted, and I paraphrase, the problem was not with the update but with the user
    There is no problem and I see no reason to reapply the update to this box since it had no effect on my sandbox MBP.

  • I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    Where are you located?
    Just go and buy an iTunes gift card at any store in your country.
    Then follow all the steps you did, but when it asks you for the credit card number, there shoujld be a GIFT CARD option which will let you load your account witht eh funds form the gift card without providing a credit/debit card #.

  • HT4059 How do I make ibook purchase with iTunes gift card rather than credit card on account.

    How do I make ibook purchase with iTunes gift card rather than credit card on account.

    go to settings- itunes app store- click appleid and view account - may need password - then under billing info select none.  however it will auto use the gift card regardless first

  • Not able to make any call with my lumia 710

    Not able to make any call with my lumia 710 though other then call everything is working fine. I chacked my SIM in other phone, i there phone i can make calls. Whats wrong with my phone?

    hi
    i am using nokia lumia since last 6 months. i am having aitel connection. till few days back i was able to make phone calls however now phone calls are immediately getting ended.  i m able to send sms, receive calls and use intenel..problem presisits only with receiving call..
    suggest me a way out..plz..

  • I bought my iPad mini two weeks ago and used my apple ID to make it synch with my iPhone. But so far I have not been able to activate iMessage and face time. It only gives me the option of signing i

    I bought my iPad mini two weeks ago and used my apple ID to make it sync with my iPhone. But so far I have not been able to activate iMessage and face time. It only gives me the option of signing in and when I do that I get an error message telling me that either my user name or password for my email is incorrect; even though I have been using my correct my apple ID in the password entry area. My apple ID works for every thing else. Please, can you help in this case?

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    SHARING iTunes MUSIC
    http://macmost.com/five-ways-to-share-music-in-itunes.html
    Also... Create your Own Apple ID for Your iPhone...
    It should be Noted that anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622
    And... Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    See Here for  >  How to Use Multiple iDevices with One Computer
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha

  • Is there a way to make itunes autostart with windows in mini mode

    Is there a way to make itunes autostart with windows in mini mode i.e the taskbar player mode where it is most less obstrusive . itune takes a lot of time to start under windows

    Just delete the same songs from your library in iTunes.  Select the first song, hold the shift key, select the last song (which will select everything in between) and press delete.

  • How do i make a slideshow with iphoto for my mother and view on apple TV?

    How do i make a slideshow with iPhoto fo rmy mother and view on my appleTV.  I guess i need to know the best/easiest way.  Do i create a slideshow in iPhoto and then it will automatically pop up on my apple TV Photos?  or is it really not that easy?  i don't want to do airplay......i would like to sit and enjoy it with her.
    m

    icloud sync would only be an option if you login with your appleID
    so think flickr is the easy way

  • How do I set up my airport express to make a connection with my Hp? I already have it set up for my mac laptop just not sure how to set it up so that theres also a connection with my Hp

    how do I set up my airport to make a connection with my Hp? I already have it set up for my mac laptop just not sure how to set it up so that theres also a connection with my Hp

    I set up my new HP Descjet 3054A . I had a problem becouse Apple give me CD as a driver. The thing was that CD wasn good for this printer becouse it was old software:) I had to go to Apple store so the specialist had to download me he wright driver. Becouse I didnt wannet to screw this up . When he downloaded driver I fired it up at house and thingworks perfect. The thing is when you download all the software from HP side . Then you have to connect your MAC to printer via USB . Fallow the instructions it should works. Worked for me. Good Luck!

Maybe you are looking for