@Test public void labelTextExtentCanBeCalledSafelyOutsideEDT() { Dimension dim = DialogUtils.getHtmlLabelTextExtent("foo", 300, true); }
public static Dimension getHtmlLabelTextExtent( final String labelText, final int fixedDimSize, final boolean width) { final Dimension[] result = new Dimension[1]; if (SwingUtilities.isEventDispatchThread()) { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } else { try { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } }); } catch (Exception ex) { throw new RuntimeException(ex); } } return result[0]; }
DialogUtils { public static Dimension getHtmlLabelTextExtent( final String labelText, final int fixedDimSize, final boolean width) { final Dimension[] result = new Dimension[1]; if (SwingUtilities.isEventDispatchThread()) { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } else { try { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } }); } catch (Exception ex) { throw new RuntimeException(ex); } } return result[0]; } }
DialogUtils { public static Dimension getHtmlLabelTextExtent( final String labelText, final int fixedDimSize, final boolean width) { final Dimension[] result = new Dimension[1]; if (SwingUtilities.isEventDispatchThread()) { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } else { try { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } }); } catch (Exception ex) { throw new RuntimeException(ex); } } return result[0]; }  }
DialogUtils { public static Dimension getHtmlLabelTextExtent( final String labelText, final int fixedDimSize, final boolean width) { final Dimension[] result = new Dimension[1]; if (SwingUtilities.isEventDispatchThread()) { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } else { try { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } }); } catch (Exception ex) { throw new RuntimeException(ex); } } return result[0]; }  static void showCentred(final Window dialog); static void showCentredOnParent(final Window parent, final Window dialog); static List<T> getChildComponents(
            Class<T> clazz, Container parent, boolean includeNested); static String getString(String input, String fallback); static Dimension getHtmlLabelTextExtent(
            final String labelText, final int fixedDimSize, final boolean width); }
DialogUtils { public static Dimension getHtmlLabelTextExtent( final String labelText, final int fixedDimSize, final boolean width) { final Dimension[] result = new Dimension[1]; if (SwingUtilities.isEventDispatchThread()) { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } else { try { SwingUtilities.invokeAndWait( new Runnable() { @Override public void run() { result[0] = doGetHtmlTextExtent(labelText, fixedDimSize, width); } }); } catch (Exception ex) { throw new RuntimeException(ex); } } return result[0]; }  static void showCentred(final Window dialog); static void showCentredOnParent(final Window parent, final Window dialog); static List<T> getChildComponents(
            Class<T> clazz, Container parent, boolean includeNested); static String getString(String input, String fallback); static Dimension getHtmlLabelTextExtent(
            final String labelText, final int fixedDimSize, final boolean width);  }