public void run() { CompletionQuery.Result res = lastResult; if (res != null) { getPane().setTitle(res.getTitle()); getView().setResult(res); if (isPaneVisible()) { getPane().refresh(); } else { getPane().setVisible(true); } } else { getPane().setVisible(false); caretPos = -1; } } });