Java/GWT/DockPanel

Материал из Java эксперт
Перейти к: навигация, поиск

Using DockPanel

   <source lang="java">

package com.jexp.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.DockPanel; public class GWTClient implements EntryPoint{

 public void onModuleLoad() {
   DockPanel dock = new DockPanel();
   dock.setHorizontalAlignment(DockPanel.ALIGN_CENTER);
   HTML north0 = new HTML("This is the first north component", true);
HTML east = new HTML("
This
is
the
east
component
", true);
   HTML south = new HTML("This is the south component");
HTML west = new HTML("
This
is
the
west
component
", true);
   HTML north1 = new HTML("This is the second north component", true);
   dock.add(north0, DockPanel.NORTH);
   dock.add(east, DockPanel.EAST);
   dock.add(south, DockPanel.SOUTH);
   dock.add(west, DockPanel.WEST);
   dock.add(north1, DockPanel.NORTH);
   dock.add(new HTML("Center"), DockPanel.CENTER);
   RootPanel.get().add(dock);
 }

}


      </source>