Re: Drawing an Image in a JPanel



john wrote:

... 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?
....
That's exactly what I am aiming for - An Image editor that can perform
cropping, resizing, and flipping. What would be the best approach?

OK. While I am sure that a JLabel is the wrong component
for this use, I am ot entirely sure of the best design/approach,
and am hoping that others will jump in with further advice on
that matter.

Additional security question, does Java supports reading/writing image
files from the local HD while running as an Applet embedded in a web
page?

Yes. But only if the applet is signed and accepted as
'secure' code by the end user.

Applets are not for the faint-hearted, they will bring
you no end of trouble, and are suspected as a leading
cause of madness in Java GUI developers.

Would a web-launched *application* do the trick
for your end users? A WebStarted ('web launched')
Java application has a number of advantages over
the 'applet in a web page'. (Note that the project will
also need to be signed, to use this approach).

Andrew T.

.



Relevant Pages

  • Re: Drawing an Image in a JPanel
    ... cropping, resizing, and flipping. ... If you want to get a bit fancy, you can wrap the JPanel in a JScrollPane to let the user manipulate images that are bigger than her screen. ... You'd also probably want to keep an internal representation of the picture, to facilitate saving to disk, or doing certain types of manipulation such as supporting undo and redo. ...
    (comp.lang.java.help)
  • Re: "Window look and Feel" for JTree
    ... but then it demonstrates not just flipping ... the PLAF using components that are already onscreen, ... you could see the applet in action. ... Andrew Thompson ...
    (comp.lang.java.gui)