Hello
I am setting image to JLabel as below
ImageIcon icon=new ImageIcon(PathToImage,"Image");
jLabel4.setIcon(icon);
I have set label size as 5cm x5 cm square.
Whenever i am setting icon to Jlabel it is not shown fully .. only part of image is shown in jlabel.
How to solve this ?
Thanks !
I have scaled image using [java-image-scaling][1]
[1]: http://code.google.com/p/java-image-scaling/ Library.
With scaling image is very simple just need to add two lines
ResampleOp resampleOp = new ResampleOp (100,200);BufferedImage rescaledTomato = resampleOp.filter(tomato, null);
“tomato ” is name of image you want to scale. and (100,200) parameters specifies width & height of scaled image.
Thanks