我正在尝试运行'简单对话框'在我身边的例子。我已按照此处http://docs.sencha.com/gxt/3.x/getting_started/maven/Archetypes.html
的说明从公共原型创建了一个项目然后我复制并粘贴了来自https://www.sencha.com/examples/#ExamplePlace:dialog的示例代码,这些代码创建了一个简单的'对话。现在我的SandboxyEntryPoint类看起来像:
for (int i = 0; i < NumberOfChunks; i++)
{
byte[][] myFile = new byte[NumberOfChunks][];
myFile[i][0] = buffer[i]; // IT STOPS HERE AND GIVES ME THE ERROR
if ((i + 1) == NumberOfChunks)
{
do sth....
}
}
然后我去了&#39; Sandboxy.css&#39;并添加了以下css-class:
package com.sencha.examples.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.GXT;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.box.MessageBox;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class SandboxyEntryPoint implements EntryPoint {
final String TEXT = "Lorem Ipsum is simply dummy text of the printing" +
" and typesetting industry. Lorem Ipsum has been the industry's" +
" standard dummy text ever since the 1500s.";
@Override
public void onModuleLoad() {
String version = GXT.getVersion().getRelease();
TextButton textButton = new TextButton("Verify GXT Works: Version=" + version);
RootPanel.get().add(textButton);
textButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
final Dialog simple = new Dialog();
simple.setHeadingText("Dialog Test");
simple.setPredefinedButtons(Dialog.PredefinedButton.YES, Dialog.PredefinedButton.NO);
simple.setBodyStyleName("pad-text");
simple.add(new Label(TEXT));
simple.getBody().addClassName("pad-text");
simple.setHideOnButtonClick(true);
simple.setWidth(300);
simple.show();
// MessageBox messageBox = new MessageBox("GXT Works.");
// messageBox.show();
}
});
}
}
我在这里遇到的主要问题是底部的控制按钮放置不正确,右边有一个间隙:
虽然在例子中一切似乎都是正确的:
我已经尝试了GWT 2.6.1和2.7.0同样的结果。请指出我做错了什么?
P.S。我已经问过这个问题on Sencha forum,但看起来已经死了。所以我在这里问。