Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:30:18+00:00 2026-06-01T10:30:18+00:00

Possible Duplicate: Comparing functionality between KeyListeners and Key Bindings I’ve been trying to use

  • 0

Possible Duplicate:
Comparing functionality between KeyListeners and Key Bindings

I’ve been trying to use the KeyListener in my program in order to get the input for constructing a number. It doesn’t work as far as I can tell even though i’ve fully implemented it but thats not the question :P.

Anyway, I searched the internet in order to see if I was doing something wrong and came across Keybindings which are apparently made to work with swing components as opposed to KeyListeners. Which would be better for just getting the input from the number keys?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:30:19+00:00Added an answer on June 1, 2026 at 10:30 am

    The Keylistener is an older interface from the AWT days, its still Ok to use it with swing but is more of a general listener. It binds to all keys.

    KeyBindings are a bit different in that they specifically bind a specific action to a specific key and other keys remain unaffected. The upshot of this is if you are going to listen for any key then a KeyListener is appropriate or you will have to implement seperate KeyBindings all for all keys which is patently silly.

    To avoid event handlers with big switch statements the KeyBinding exists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Comparing Two Arrays Using Perl I am trying to find elements that
Possible duplicate : comparing-two-arrays I have two NSArray and I'd like to create a
Possible Duplicate: Comparing object properties in c# Let's say I have a POCO: public
Possible Duplicate: Comparing Strings in Cocoa Why is this code not recognising the NSString
Possible Duplicate: Python ‘==’ vs ‘is’ comparing strings, ‘is’ fails sometimes, why? In Python,
Possible Duplicate: Why is my comparing if statement not working? I am attempting to
Possible Duplicate: Python ‘==’ vs ‘is’ comparing strings, ‘is’ fails sometimes, why? Is a
Possible Duplicate: Comparing Two Arrays Using Perl How can I print values which exist
Possible Duplicate: problem in comparing double values in C# I've read it elsewhere, but
Possible Duplicate: Compiling a java program into an exe Hi, I'd like to convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.