I am using a SwingWorker to read data over a TCP connection and display when it comes back.
new SwingWorker() {
@Override
publi
Yes, the solution you linked to is a reasonable and easy solution ("best" is so subjective :) You could leverage SwingWorker#get, that is part of the Future interface:
SwingWorker<EnvInfoProto, Void> worker = new SwingWorker<EnvInfoProto, Void>() {
...
};
worker.execute();
worker.get(15, TimeUnit.SECONDS);
//will block 15 seconds at most, then throw TimeoutException
Of course you could come up with different ways to reach your goal, but I'd bet there is more code involved than in this solution, so I'd give it a try.