0

I want to add a selectable image to a PadDraw() of a JFrame container.
So how can I do it?
I've got a idea that it can be done by JLabel, but I think it's not selectable. So, how can I add that?

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by soham.m17
0

Look at MouseListener and MouseMotionListener.
Check if a mouse button has been pressed, and where the cursor is.

0

Look at MouseListener and MouseMotionListener.
Check if a mouse button has been pressed, and where the cursor is.

The basic question is how to add a image ti this PadDraw() which is a JComponent.
So how to add an image to a JComponent and the image should be movable. Is it possible by Label?

1

Yes, you can use your image to make an ImageIcon and put that in your JLabel. Documentation is in the usual places.

0

Yes, you can use your image to make an ImageIcon and put that in your JLabel. Documentation is in the usual places.

Can I write code to move the label through mouse? like by MouseMotionListener and others...

0

Yes, you can use your image to make an ImageIcon and put that in your JLabel. Documentation is in the usual places.

Can I write code to move the label through mouse? like by MouseMotionListener and others...
I mean that is the thing will be selectable and movable?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.