Reputation: 28556
I have a Table like below, but when table lost focus (click some button for example), selection lost too. How to avoid this ?
Table table = new Table(group, SWT.BORDER | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
onSelection();
}
});
row selected:
selection lost:
Upvotes: 0
Views: 718
Reputation: 8849
You can change the background and foreground colour of the selected table item. See here Highlighting swt table row on focus lost
Upvotes: 0
Reputation: 12718
Ahh, so your table does not show the selected row when the table does not have focus? That is a well known problem in several different editions of Windows.
Please Note: It is not a SWT problem, but simply the way some editions of Windows work!!
Upvotes: 1