int () { if (ApplicationManager.getApplication().isDispatchThread()) return myDelegate.getCommittedTextLength(); final int[] r = new int[1]; try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { r[0] = myDelegate.getCommittedTextLength(); } }); } catch (InterruptedException e) { LOG.error(e); } catch (InvocationTargetException e) { LOG.error(e); } return r[0]; }