Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MouseListener isn't working right

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is wrong with my code? The only thing that works (out of the MouseListener and KeyListener) is the MouseListener. Partially. It is printing out the System.out.println line. It is not doing anything else.

Thanks,
cc11rocks
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened? Please post the code output.

Jim ...
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim Hoglund wrote:What happened? Please post the code output.

Jim ...

No error message. I just was testing to see if it was working. I just added a System.out.println statement and it ran fine.
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please talk more about your problem so we can see that you understand
the code and what it is intended to do. We want to help but please don't
make us guess about your question.

Jim ...
 
Rob Camick
Ranch Hand
Posts: 2542
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Up and Down don't generate valid characters. You should be use keyPressed() not keyTyped().
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Up and Down don't generate valid characters. You should be use keyPressed() not keyTyped().

Just figured that out, thanks. Could you help me with the other problem?
Thanks,
cc11rocks
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out it was working properly. I am sorry for the question.
Thanks and sorry,
cc11rocks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic