Basically, you never actually add CreppyRectangle
to anything, therefore, there's nothing capable of listening to mouse events.
Your setup is a little weird. I don't know why you're bothering with extending from JComponent
, when you should be putting all your logical into your TestPane
Also, I don't think you want to do yPosL = e.getX()
, I think you want to try yPosL = e.getY()
instead