Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MouseListener isn't working right  RSS feed

 
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
 
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 ...
 
Rancher
Posts: 2906
18
  • 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
 
My pie came with a little toothpic holding up this tiny ad:
free 1 hour java lesson
https://coderanch.com/t/695988/free-hour-java-lesson
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!