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 3 of 3

Thread: How to defined keyboard key's like " ctrl + a ,shift + alt + b " through program??

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Location
    Chandigarh, India
    Posts
    6
    My Mood
    Cool
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to defined keyboard key's like " ctrl + a ,shift + alt + b " through program??

    everyone,
    Actually the question is that how can we define keyboard key's in the program not normal alphabetic or numeric keys,keys should be defined " cntr + s " or "alt + shift + f etc." and specific action takes place with the help of these keys on command prompt...., can i get any suitable idea.. ???


  2. #2
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: How to defined keyboard key's like " ctrl + a ,shift + alt + b " through program?


  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to defined keyboard key's like " ctrl + a ,shift + alt + b " through program?

    It depends how you wish to receive events. The above link provided might help for JMenus (and I'd recommend going to the newer API, rather than a 10 year old one). The following might help as well
    How to Use Key Bindings (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)
    How to Write a Key Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)

Similar Threads

  1. "Program execution skips the "if" statement"!
    By antony1925 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 7th, 2012, 07:15 AM
  2. JButton with "Enter Key" keyboard action
    By chronoz13 in forum Java Swing Tutorials
    Replies: 2
    Last Post: March 14th, 2012, 06:49 AM
  3. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  4. JButton with "Enter Key" keyboard action
    By chronoz13 in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: January 26th, 2010, 10:53 AM
  5. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 08:35 AM