| Author |
JButton with ImageIcon Size Problem
|
Lou Pellegrini
Ranch Hand
Joined: Nov 11, 2003
Posts: 105
|
|
Hi, I have a JButton with an ImageIcon showing just fine. I need to be able to resize the button and of course its icon, but when the button gets to small the icon disappears. Is there a way I can dynamically change the size of the icon to fit the JButton? Or am I stuck making several icon files? Thank You in Advance for Your Help, Lou
|
 |
KR Campbell
Ranch Hand
Joined: Mar 26, 2004
Posts: 124
|
|
Hi, If you are using an ImageIcon then it has a getScaledInstance() method. I seem to remember using this for something similar once. Regards, Ken
|
 |
Craig Wood
Ranch Hand
Joined: Jan 14, 2004
Posts: 1535
|
|
|
|
 |
Lou Pellegrini
Ranch Hand
Joined: Nov 11, 2003
Posts: 105
|
|
Thank you Craig! That is exactly what I needed! Lou
|
 |
 |
|
|
subject: JButton with ImageIcon Size Problem
|
|
|