class 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) {
                // Either an InterruptedException or an InvocationTargetException
                // both of which are fatal
                throw new RuntimeException(ex);
            }
        }
        
        return result[0];
    }

}