使用gxt前,在gwt.xml中加入:
- <inherits name='com.sencha.gxt.ui.GXT' />
- <inherits name='com.sencha.gxt.theme.gray.Gray' />
- <set-property name="gxt.user.agent" value="chrome"/>
html文件加入:
- <link rel="stylesheet" type="text/css" href="gxt1/reset.css" />
若是maven构建,在home/.m2/archetype-catalog.xml中加入:
- <?xml version="1.0" encoding="UTF-8"?>
- <archetype-catalog>
- <archetypes>
- <archetype>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>gwt-maven-plugin</artifactId>
- <version>2.5.0-rc2</version>
- <repository></repository>
- </archetype>
- </archetypes>
- </archetype-catalog>
gxt中页面的根是container,有好几个不同的container,现在只会用了BorderLayoutContainer,类似页面设计中的header,left,right,footer以及中间center元素。
在Container上面可以添加任意个ContentPanel,也可以添加其他任意的元素
转载于:https://blog.51cto.com/xiaosa/1039317