HTML Control With Style : HTML « GWT « Java






HTML Control With Style

  

package com.java2s.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Grid;

public class GWTClient implements EntryPoint{
  public void onModuleLoad() {
    HTML html = new HTML("caption");
    html.setStyleName("layouts-Label");

    RootPanel.get().add(html);
  }
}
///////
.layouts-Label {
  background-color: #C3D9FF;
  font-weight: bold;
  margin-top: 1em;
  padding: 2px 0px 2px 0px;
  width: 100%;
}
///////////
<module>
  <inherits name="com.google.gwt.user.User"/>
  <entry-point class="com.java2s.gwt.client.GWTClient"/>
  <stylesheet src='your.css'/>
</module>


           
         
    
  








GWT-HTMLWithStyle.zip( 2 k)

Related examples in the same category

1.Output HTML with HTML control
2.The HTMLFlow displays HTML in a free-form, flowable region (Smart GWT)The HTMLFlow displays HTML in a free-form, flowable region (Smart GWT)
3.HTMLPane displays standard HTML in a sizeable, scrollable pane (Smart GWT)HTMLPane displays standard HTML in a sizeable, scrollable pane (Smart GWT)
4.Display different chunks of HTML (Smart GWT)Display different chunks of HTML (Smart GWT)
5.Using HTMLFlow to hold large chunk of HTML (Smart GWT)Using HTMLFlow to hold large chunk of HTML (Smart GWT)
6.Change CSS for HTMLFlow panel (Smart GWT)Change CSS for HTMLFlow panel (Smart GWT)
7.Combo with Templates and Ajax (Ext GWT)
8.Template example (Ext GWT)Template example (Ext GWT)