gwt 线程控制

package com.dr.b2b.clien.ui.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Project implements EntryPoint {

private int add = 5;

public void onModuleLoad() {
Button slide = new Button("slide");
final VerticalPanel dec = new VerticalPanel();
dec.ensureDebugId("ver");
final HorizontalPanel hor = new HorizontalPanel();
hor.add(new HTML("aaaaa"));
hor.setWidth("800px");
hor.setHeight("0px");
hor.setStyleName("hor");
dec.add(hor);
dec.add(slide);

slide.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {
for (int i = 0; i < 20; i++) {
Timer timer = new Timer() {

@Override
public void run() {

hor.setHeight(add + "px");
add += 10;

}

};

timer.schedule(200);
}

}

});

RootPanel.get().add(dec);

}

}

你可能感兴趣的:(html,UI,Google,gwt)