Dear All, I want to set icon size in JLabel. The icon may be big in size say 500*500. But i want to set the image size to 32*32. There is no API in ImageIcon to set the size. I also tried to set using setPreferredSize,setMaximumSize, setMinimumSize,setSize API's in JLabel. But it didn't work for me. Can anyone tell me the procedure for it. It will be very helpful for me. Thanks and Regards V.S.Saravanan
Load your image file into an Image object first. Then call the getScaledInstance() method of Image to scale the image to the size you want. Then make an ImageIcon using the Image object you got back from getScaledInstance().
Write once, run anywhere, because there's nowhere to hide! - /. A.C.