d = new Display();
s = new Shell(d);
s.setSize(250,200);
s.setImage(new Image(d, "c:\\icons\\JavaCup.ico"));
s.setText("A MouseTrackListener Example");
final Button b = new Button(s, SWT.PUSH);
b.setText("Push Me");
b.setBounds(20,50, 55, 25);
s.open();
final Color oldColor = b.getBackground();
b.addMouseTrackListener(new MouseTrackAdapter() {
public void mouseEnter(MouseEvent e)
{
b.setBackground(new Color(d,0,153,153));
}
public void mouseExit(MouseEvent e)
{
b.setBackground(oldColor);
}
});
while(!s.isDisposed()){
if(!d.readAndDispatch())
d.sleep();
}
d.dispose();