Thanks for both replies. Jacek, your method worked

Now I have another question about using the canvas from multiple threads. I have a multithreaded server that will be receiving coordinates from multiple clients and I want to visualize this in real-time (I will move the boxes, and change the rotation). What do I need to do to make this threadsafe? I know that the canvas itself is just a data structure, so is it ok to add things to it/move things from any thread (using a mutex lock, of course), and only the update has to be called from the main GUI thread? I can't find any detailed info on this issue in the documentation.
Thanks!