Hi all
I'm trying to get a JButton to change the image when the mouse is over
it, but I can't get it to work.
The code:
ImageIcon icon = new ImageIcon("images/MRButton.png"");
JButton MRButton = new JButton(icon);
button.addMouseListener(new MouseListener(){
public void mouseEntered(MouseEvent arg0) {
//I have tried this - but i don't work :(
icon = new ImageIcon("lommeregner/images/MRButton_over.png");
}
public void mouseExited(MouseEvent arg0) {
//some code here ...
}
}
Can someone give me a hint to solve this little problem ?
/Brian
SadRed - 01 Oct 2007 01:56 GMT
> Hi all
>
[quoted text clipped - 23 lines]
>
> /Brian
setRolloverIcon()