I wanted to try something for a small program I'm writing. I'm trying to write a mouse listener that can detect if the right mouse button is pressed without having to write a gui. I've implemented the MouseListener class, but the event doesn't seem to fire if I don't extend JPanel or JFrame. Any suggestions?