Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将背景图像应用于GWT装饰器面板_Gwt - Fatal编程技术网

将背景图像应用于GWT装饰器面板

将背景图像应用于GWT装饰器面板,gwt,Gwt,这是我的视图,它是使用装饰面板构建的。 如何修改此选项以显示背景图像?我看到了很多应用CSS样式的例子,但我的CSS知识有限,所以如果这是一种方法,那么任何人都会有一个如何创建和应用CSS样式的工作示例 这是我的密码 公共类EditContactView扩展复合实现EditContactPresenter.Display{ 私有最终文本框名字; 私有最终文本框lastName; 私有最终FlexTable数据库 public EditContactView() { D

这是我的视图,它是使用装饰面板构建的。 如何修改此选项以显示背景图像?我看到了很多应用CSS样式的例子,但我的CSS知识有限,所以如果这是一种方法,那么任何人都会有一个如何创建和应用CSS样式的工作示例

这是我的密码 公共类EditContactView扩展复合实现EditContactPresenter.Display{ 私有最终文本框名字; 私有最终文本框lastName; 私有最终FlexTable数据库

      public EditContactView() {
        DecoratorPanel contentDetailsDecorator = new DecoratorPanel();
        contentDetailsDecorator.setWidth("18em");
        initWidget(contentDetailsDecorator);

        VerticalPanel contentDetailsPanel = new VerticalPanel();
        contentDetailsPanel.setWidth("100%");

        detailsTable = new FlexTable();
        detailsTable.setCellSpacing(0);
        detailsTable.setWidth("100%");         
        firstName = new TextBox();
        lastName = new TextBox();
        initDetailsTable();
        contentDetailsPanel.add(detailsTable);

        HorizontalPanel menuPanel = new HorizontalPanel();
        contentDetailsPanel.add(menuPanel);
        contentDetailsDecorator.add(contentDetailsPanel);
      }

      private void initDetailsTable() {
        detailsTable.setWidget(0, 0, new Label("Firstname"));
        detailsTable.setWidget(0, 1, firstName);
        detailsTable.setWidget(1, 0, new Label("Lastname"));
        detailsTable.setWidget(1, 1, lastName);
        firstName.setFocus(true);
      }

      public HasValue<String> getFirstName() {
        return firstName;
      }

      public HasValue<String> getLastName() {
        return lastName;
      }

      public Widget asWidget() {
        return this;
      }

    }
public EditContactView(){
DecoratorPanel contentDetailsDecorator=新DecoratorPanel();
contentDetailsDecorator.setWidth(“18em”);
initWidget(contentDetailsDecorator);
VerticalPanel contentDetailsPanel=新的VerticalPanel();
contentDetailsPanel.setWidth(“100%”);
detailsTable=新的FlexTable();
detailsTable.setCellSpacing(0);
detailsTable.setWidth(“100%”);
firstName=新文本框();
lastName=newtextbox();
initDetailsTable();
contentDetailsPanel.add(detailsTable);
HorizontalPanel菜单面板=新的HorizontalPanel();
contentDetailsPanel.add(菜单面板);
contentDetailsCorator.add(contentDetailsPanel);
}
私有void initDetailsTable(){
setWidget(0,0,新标签(“名字”);
setWidget(0,1,firstName);
setWidget(1,0,新标签(“Lastname”);
setWidget(1,1,lastName);
firstName.setFocus(true);
}
public HasValue getFirstName(){
返回名字;
}
public HasValue getLastName(){
返回姓氏;
}
公共小部件asWidget(){
归还这个;
}
}

关于设置样式名称-您只需在任何小部件上调用setStyleName(“myDecoratedPanelStyle”),然后检查gwt如何在中添加样式gwt文本框

在.css文件中添加.myDecoratedPanelStyle

myDecoratedPanelStyle 
{
   background-image:url('path/paper.gif');
   background-color:#cccccc;
}
另请参阅—