I have seen a lot of people troubled by the stuff mentioned in the topic, and while I understand the problems entirely I won’t claim to have any particularly viable solution. A forum search reveals a number of threads which basically say ‘you can do this that way’, but I have not been able to find any explicit solutions to the stuff presented below. Sorry if it has nonetheless been rehashed indefinitely already.
As you all know, most games work with only one main thread and executes everything from there. In most games there are some performance-critical parts, such as a main display, which may be actively rendered. However there are frequently information panels that would benefit from a more swing-like model, and in this context it becomes difficult to avoid threading problems. Another point is that mouse and keyboard input managed through eventlisteners generally run from the event dispatch thread.
I believe JInput offers a solution to the peripheral input problem. But if you wish to use Swing components, it is still difficult to avoid trouble unless the Event Dispatch Thread is used as the main thread for both logic and any mix of passive or active rendering. As far as I can see, doing everything from the Event Dispatch Thread is the only easy solution, but I have the feeling that this is not a common thing to do.
Another option is to get all peripheral input asynchronously, like I assume JInput would - or possibly by manually queueing all of it for execution in the other Thread. Now, the ability to perform passive rendering is - as far as I can see - lost.
Which structure do you guys use? Do you have any rants or opinions regarding this topic? What is the square root of 517? And what is the meaning of life?