Link control with CSS : CSS « GWT « Java






Link control with CSS

 



package com.java2s.gwt.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;


public class GWTClient implements EntryPoint{
   public void onModuleLoad() {
    final Label loginPrompt = new Label("Please Log In");
    final Grid grid = new Grid(3, 2);
    final Label namePrompt = new Label("Name");
    final TextBox nameTextbox = new TextBox();
    final Label passwordPrompt = new Label("Password:");
    final PasswordTextBox passwordTextbox = new PasswordTextBox();
    final Button button = new Button("Login");

    RootPanel.get().clear();

    loginPrompt.addStyleName("loginPrompt");
    loginPrompt.addStyleName("loginPrompt2");    
    nameTextbox.addStyleName("nameField");
    passwordTextbox.addStyleName("passwordField");

    grid.setWidget(0, 0, namePrompt);
    grid.setWidget(0, 1, nameTextbox);

    grid.setWidget(1, 0, passwordPrompt);
    grid.setWidget(1, 1, passwordTextbox);

    grid.setWidget(2, 1, button);
    
    RootPanel.get().add(loginPrompt);
    RootPanel.get().add(grid);
  }
}


           
         
  








GWT-CSS.zip( 2 k)

Related examples in the same category

1.Use Default StyleSheet
2.Returns a List of Element objects that have the specified CSS class name
3.Change label border with CSS (Smart GWT)Change label border with CSS (Smart GWT)