我正在学习http://www.tutorialspoint.com/gwt/gwt_style_with_css.htm上的初学者教程。HelloWorld.html 文件的代码是:
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="HelloWorld.css"/>
<script language="javascript" src="helloworld/helloworld.nocache.js">
</script>
</head>
<body>
<div id="mytext"><h1>Hello, World!</h1></div>
<div id="gwtGreenButton"></div>
<div id="gwtRedButton"></div>
</body>
</html>
在 HelloWorld.java(扩展入口点)中,我有:
RootPanel.get("gwtGreenButton").add(Btn1);
RootPanel.get("gwtRedButton").add(Btn2);
2 行: RootPanel.get() 总是导致 null。我不知道发生了什么,要检查什么?(太糟糕了,该网站没有评论/讨论部分)
谢谢。