Recently, I've faced with SWTException error when was trying to insert a new TableItem into the SWT Table from another thread. Reading java doc about TableItem class I found out, that with creation a new instance of this class, SWTException may occurred:
Throws SWTException: if not called from the thread that created the parent
It means that I can't create a TableItem instance in the thread which is distinct from that one, in which Table was created.
I wrote a simple program to reproduce my problem: it's a window with one button and with a table which has a single column. When pressing the button a new thread is started. In this thread there's a cycle in which 5 table items are created with timed out = 1 sec.
Here's a code snippet, which represents a first attempt: