0

I would like to know the best way for handling the images in Java. Till now i am doing so using ImageIcon of JLabel but i dont find the approach right as label does not has stretch property like an vb6 imagebox which automatically stretch the image to fit the container ..

Please tell me the best way .. Also mention any external library or component i can install for same . I would prefer a free library..

Also i tried swingfx library but it was not good enough

Rajit Bansal
  • 45
  • 1
  • 8

1 Answers1

1

the simple answer is you can just create a subclass of JPanel (or Canvas if you're working in awt) and in the paintComponent method (paint in the awt world), draw the image doing any scaling/skewing/translation you want.

How to make canvas with Swing?

Community
  • 1
  • 1
him
  • 608
  • 5
  • 15