Thursday, December 27, 2012

Change Font in RichTextArea

How can one change the Default Font 'Times New Roman' to 'Arial' in the RichTextArea?
I tried to do:
richtextarea.addInitializeHandler(new InitializeHandler() {
@Override
public void onInitialize(InitializeEvent event) {
IFrameElement i = IFrameElement.as(editor.getElement());
Document document = i.getContentDocument();
BodyElement body = document.getBody();
body.setAttribute("style", "font-family: Arial;");
}
});

But when I execute the 'i.getContentDocument()' I get an UmbrellaException...

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/xAZK3zo1W-YJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment