table.addListener(SWT.EraseItem, new Listener() {
public void handleEvent(Event event) {
event.detail &= ~SWT.HOT;
if ((event.detail & SWT.SELECTED) == 0) return; /// item not selected
Table table =(Table)event.widget;
TableItem item =(TableItem)event.item;
int clientWidth = table.getClientArea().width;
GC gc = event.gc;
Color oldForeground = gc.getForeground();
Color oldBackground = gc.getBackground();
gc.setBackground(colorBackground);
gc.setForeground(colorForeground);
gc.fillRectangle(0, event.y, clientWidth, event.height);
gc.setForeground(oldForeground);
gc.setBackground(oldBackground);
event.detail &= ~SWT.SELECTED;
}
});