tony xue wrote:oh, will do it. Thank you Pete!
You're welcome!
One more question, ...
Any idea? Should I create new icons that have same size?
One possible solution: If your JButtons are held in a JPanel that uses GridLayout, they'll all be the same size. For example, if the JButtons are held horizontally, then using a GridLayout(0, 1, 0, vGap) could work well where the parameters mean it will have a variable number of rows, one column, and a vertical spacing between JButtons of vGap size.