I am using several JButtons in my frame and I want to set image in JButton. I am able to set the size of image using the following code.
Image img = icon.getImage() ;
Image newimg = img.getScaledInstance( NEW_WIDTH, NEW_HEIGHT, java.awt.Image.SCALE_SMOOTH ) ;
icon = new ImageIcon( newimg );
And I also viewed the following link.
resizing a ImageIcon in a JButton
I am using WindowBuilder in my eclipse juno. And I set the image using setting the properties called icon and in the source code it generates the following code.
btnSave.setIcon(new ImageIcon(Patient_Detail.class.getResource("/Icons/download_icon.png")));
So, as my image size is comparatively bigger than my button size.
Is there any direct approach or method to set image size as the size of JButton using WindowBuider or adding any method to my current code?