我在编译用户界面时遇到问题,当我添加方法 messages.usuario() 时,Firebug 显示错误:TypeError: null has no properties lblUsuario = new Label_2(null.nullMethod()); 这是我班的代码:
public class AdministradorMVP implements EntryPoint {
private MessageConstants messages;
@Inject
public void setMensajes(MessageConstants mensajes) {
this.messages = mensajes;
}
private final MyWidgetGinjector injector = GWT.create(MyWidgetGinjector.class);
private Place defaultPlace = new SignInPlace("Admin");
private SimplePanel appWidget = new SimplePanel();
/**
* This is the entry point method.
*/
Label lblUsuario = new Label(messages.usuario());
Label lblNombre = new Label(messages.nombre());
所以找不到问题的根源,谢谢