Hi, i want to stretch my button's icon to fit it on the whole button when i increase the size of button through coding. e.g if i have a button size 51,51 and an icon size 50,50.....it is exactly fit on the button.....but what if i change the size of the button 100,100 and wants that the image 50,50 stretch according to the new size of the button and exactly fit on it. Plzzz help me Thanks Bye
To be honest, I have no idea. You would have to check that out with some tests.
Still, my guess is that stretching it through paintComponent will not be slower. It can sometimes use the graphics card for that, and even if it can't, it should still be just as fast / slow as scaling manually.
And of course, after you've scaled it, it needs to be drawn again.
subject: How to stretch icon to fit on JToggleButton