Changeing the JButtion color when Mouseevent occurs
Hi.
In my swing application I want to change the color of my JButton. when I move My mouseover the JButton, i want to change the color of JButton permanently when i click the JButton.
Thanks in advance
cheers
Mallik
[248 byte] By [
mallik.83a] at [2007-11-27 10:28:08]

# 1
use mousemotion listener and action listener.
then use setBackground(Color);
mouse motion:
button.addMouseMotionListener( new java.awt.event.MouseMotionListener() {
public void mouseDragged(MouseEvent e) {
}
public void mouseMoved(MouseEvent e) {
// code here
}
})
Action listener:
btnAdd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
Message was edited by:
Yannix
Message was edited by:
Yannix