smartgwt 制作有背景图片的banner

来源:互联网 发布:macbook pro便捷软件 编辑:程序博客网 时间:2024/05/18 01:18


import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;

public class TopBarWithBackground extends HLayout{

 public TopBarWithBackground(){
  setWidth("100%");
  setHeight("20");
  ToolStrip topBar = new ToolStrip();
  topBar.setBackgroundImage("backgrounds/leather.jpg");
  Label title = new Label("Digit chased.");
  topBar.addMember(title);


  topBar.addFill(); //以后添加内容靠右
  Label userInfo = new Label("Welcome admin.");
  topBar.addMember(userInfo);
  addMember(topBar);
 }
}