Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: setAccelarator keyevent

  1. #1
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default setAccelarator keyevent

    hello any idea how i can set a accelerator for a menu item with shift, mac, letter

    item.setAccelerator(KeyStroke.getKeyStroke(
    java.awt.event.KeyEvent.VK_S,
    java.awt.Event.META_MASK));

    this but with the shift key before the meta_mask mac
    System.out.println(" dream in code ");


  2. #2
    Member Wolverine89's Avatar
    Join Date
    Aug 2013
    Location
    Netherlands
    Posts
    101
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: setAccelarator keyevent

    this was the solution:
    item.setAccelerator(KeyStroke.getKeyStroke(
            	        java.awt.event.KeyEvent.VK_S, 
            	        java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.META_MASK));
    System.out.println(" dream in code ");

Similar Threads

  1. Keyevent while JOptionPane inputdialog is open
    By Freddy_ in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 4th, 2013, 01:22 PM
  2. Using Keyevent
    By sbjibo in forum AWT / Java Swing
    Replies: 1
    Last Post: June 2nd, 2012, 12:14 PM
  3. KeyEvent Running Twice?
    By JuLiAnc in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2012, 04:43 PM