File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes MouseListener isn't working right Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MouseListener isn Watch "MouseListener isn New topic
Author

MouseListener isn't working right

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
What happened? Please post the code output.

Jim ...


BEE MBA PMP SCJP-6
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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

Joined: Jan 09, 2008
Posts: 525
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

Joined: Jun 13, 2009
Posts: 2180
    
    7
Up and Down don't generate valid characters. You should be use keyPressed() not keyTyped().
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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

Joined: Feb 24, 2011
Posts: 495

I found out it was working properly. I am sorry for the question.
Thanks and sorry,
cc11rocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseListener isn't working right