java swing resize ImageIcon according to jLabel
i am a new programmer here and i have something to ask, i have browse a picture into my GUI (and set the path in text box also)which displays on a Label, but the label dimension is set only 100,100 while the picture is much bigger so when i open/display it into the label it get cropped , is there anyway to make it auto resize to the label size? below is my logic code on browse button and open dialog box please any one tell me where i am wrong.. public class ImagePath extends javax.swing.JFrame { private JPanel contentPane; JLabel jLabel1; String s2; File targetFile; BufferedImage targetImg;