L
Leo Smith
Dear All,
I want to write a subclass of JPanel.
The new kind of JPanel can handle Mouse Events so that I can click
inside of it and create rectangles. I have looked at
MouseInputAdapter(abstract class)
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/event/MouseInputAdapter.html
and MouseInputHandler
http://java.sun.com/j2se/1.5.0/docs....html#mousePressed(java.awt.event.MouseEvent)
I still don't know how to do it. I need the information where the mouse
was pressed and where the mouse was released. But I don't know how to
use the methods in above classes to obtain such information.
Thank you very much.
BTW, how can I find out if such a new JPanel has been created by
somebody else and is already available?
I want to write a subclass of JPanel.
The new kind of JPanel can handle Mouse Events so that I can click
inside of it and create rectangles. I have looked at
MouseInputAdapter(abstract class)
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/event/MouseInputAdapter.html
and MouseInputHandler
http://java.sun.com/j2se/1.5.0/docs....html#mousePressed(java.awt.event.MouseEvent)
I still don't know how to do it. I need the information where the mouse
was pressed and where the mouse was released. But I don't know how to
use the methods in above classes to obtain such information.
Thank you very much.
BTW, how can I find out if such a new JPanel has been created by
somebody else and is already available?