Re: Drawing an Image in a JPanel



john wrote:

Please put your replies *below* the relevant comment.
like ..below. Otherwise I get very confused.

Thanks for the tips! Jlabel works fine.

You're welcome.

Now I would like to add Image crop application on this label that works
like in the photo editing software e.g. select a cropping rectangle
with the mouse etc, can you give me a hint what would be the best
approach to do it.

OK. Unfortunately, now that I know (a little) more
about your requirement, I don't think a JLabel is
the best thing to use.

What is this thing you are writing? Would
'Image Editor' be a good description?

If so, using a JLabel would be 'wrong'. JLabel's
are good for 'get an image and show it' - but if
you need anything more than that (zooming/resizing,
cropping, flipping, filtering, color palette changing..)
a JLabel simply gets in the way.

Put first lets get precise on your requirements for this
project. What does it do?

Andrew T.

.