Is there a way to display HTML in a GWT Panel?
+2
A:
Ahhh. I was thinking about it differently. It's the widget I'm putting into the panel that needs to be formatted. Therefore if I do a
HTML example = new HTML(someText)
then add it to a panel it'll work :)
day_trader
2010-01-19 12:51:10
+4
A:
Short Answer: You can add HTML to a GWT Panel by creating an HTML widget and attaching that widget to your panel. For example...
HorizontalPanel hp = new HorizontalPanel();
HTML html = new HTML("<p>This is html with a <a href='www.google.com'>link</a></p>");
hp.add(html); // adds the widget to the panel
Long Answer: There are a variety of ways that you can add HTML to a GWT Panel. You should start by reading the Developer's Guide for GWT. Specifically, you should read the portions on Layout Using Panels and Widgets.
prometheus
2010-01-19 12:58:22
+1
A:
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
RootPanel.get().add(new HTML("<b>Gwt Html</b>"));
you can add this HTML widget to any panel with "panel.add(widget);
" code
Kerem
2010-01-19 12:59:06
+3
A:
Also, the new declarative UI stuff in GWT 2.0 saves you from having to embed HTML into your Java.
<g:HTMLPanel>
Here <strong>is some HTML</strong>.
</g:HTMLPanel>
AlexJReid
2010-01-19 14:09:44