dcsimg
JButton - problem with setRolloverIcon
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Amit_Rosner
Posted On:   Sunday, September 30, 2001 08:09 AM

Hi! I wish to create a button with all its relevant icons (default, pressed, rollover and disabled). I call from its constructor a method "setIcons" that does that: setIcon(*some image*); setDisabledIcon(*some image*); setPressedIcon(*some image*); setRolloverIcon(*some image*); Alas, the rollover icon does not seem to load (simply when I move the mouse over the button). Other images load well. However, since my button implements ActionListener, if I call to "setIcons" in "actionPerformed", then the rollover icon works well. Bottom line - the rollover icon does not load until I press the b   More>>

Hi!


I wish to create a button with all its relevant icons (default, pressed, rollover and disabled). I call from its constructor a method "setIcons" that does that:



setIcon(*some image*);

setDisabledIcon(*some image*);

setPressedIcon(*some image*);

setRolloverIcon(*some image*);



Alas, the rollover icon does not seem to load (simply when I move the mouse over the button). Other images load well.



However, since my button implements ActionListener, if I call to "setIcons" in "actionPerformed", then the rollover icon works well.



Bottom line - the rollover icon does not load until I press the button for the first time. WHY???

   <<Less
About | Sitemap | Contact