An issue with SWT is that other threads/stuff (such as CurrencyThread) running outside of the main Thread (in this case, InitGUI/InitJSON --> ConnectIRC) cannot modify SWT stuff, afaik.
Doing so will result in an invalid thread exception. Not really sure how to fix this issue... according to online, attempting to run CurrencyThread asynchronously with the Display will result in nothing being done, due to the main thread hanging on something unknown, or it being stupid. (probably the latter) Running it synchronously makes it freeze, or just flat out doesn't work. Results vary.
However, if this issue isn't fixed, the entire program adds on CurrencyThread to the main thread, allowing CurrencyThread to pause execution of other stuff in the main thread, such as IRC connections and GUI closing and stuff. This isn't good... by then the entire main thread depends on one class that should be separate anyways.
According to the documentation, SWT is single-threaded and therefore, programs should be laid out like this:
- UIThread
- Everything else that updates it. (like CurrencyThread)
- Move/Command threads.
This means that CurrencyThread shouldn't handle/create any UI stuff, and instead, just update the UI with stuff like outputs/SQL updates/etc.