Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Fubarable

Thread: problem with mouse and keylistener

  1. #1
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default problem with mouse and keylistener

    hello everyone.,
    I am designing a simple calculator these days,and added actionevent and mouselistener and keylistener successfully.

    when i run the program and give input from keyboard it takes successfully, after clicking a button with mouse when i give input from keyboard it does not take any input.
    please help.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: problem with mouse and keylistener

    Don't use a KeyListener. Swing was designed to work with Key Bindings.
    How to Use Key Bindings (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: problem with mouse and keylistener

    i had seen the tut but it is complicated,can anyone write some code for one button .

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: problem with mouse and keylistener

    Quote Originally Posted by heman View Post
    i had seen the tut but it is complicated,can anyone write some code for one button .
    That person should be you. Seriously -- you learn by trying. Please feel free to show use your code attempt if it doesn't work.
    DarrylBurke likes this.

Similar Threads

  1. A problem with KeyListener
    By Reskaillev in forum New To Java
    Replies: 4
    Last Post: 07-22-2011, 02:29 AM
  2. KeyListener Graphics Problem
    By Makesfolkslose in forum New To Java
    Replies: 2
    Last Post: 05-26-2011, 04:07 AM
  3. Problem with Keylistener, some help pls
    By syon in forum AWT / Swing
    Replies: 1
    Last Post: 01-21-2011, 01:31 AM
  4. AWT KeyListener Problem
    By plm-pusik in forum New To Java
    Replies: 15
    Last Post: 11-10-2010, 03:38 PM
  5. KeyListener problem
    By siyi90 in forum AWT / Swing
    Replies: 7
    Last Post: 02-08-2010, 10:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •