Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 2940
19
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!