How to resize images to fit JLabel?
Hello, I need to load an image and use it in multiple places on my GUI but at different sizes.
So far I am just loading it with
Then I make a JLabel and size it to what ever size I need then use:
ImageIcon testIcon = new ImageIcon("images/testCard.jpg");
Then im left with a proper sized JLabel but only shows a portion of the image.
How do I go about resizing this image to (in this case) shrink and resize to the size of the JLabel. I was looking through the ImageIcon java docs but didnt see anything about resizing.
Thanks for any tips.