HTML --------------->>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<title>StockWatcher</title>
<script type="text/javascript" language="javascript"
src="com.srcm.MemberApp.nocache.js"></script>
</head>
<body>
<h1>Stock Watcher</h1>
<div id="stockList"></div>
</body>
</html>
Java Code -------->>
package com.srcm.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class MemberApp implements EntryPoint {
/**
* This is the entry point method.
*/
private VerticalPanel mainPanel = new VerticalPanel();
private FlexTable stocksFlexTable = new FlexTable();
private HorizontalPanel addPanel = new HorizontalPanel();
private TextBox newSymbolTextBox = new TextBox();
private Button addButton = new Button("Add");
private Label lastUpdatedLabel = new Label();
public void onModuleLoad() {
// set up stock list table
stocksFlexTable.setText(0, 0, "Symbol");
stocksFlexTable.setText(0, 1, "Price");
stocksFlexTable.setText(0, 2, "Change");
stocksFlexTable.setText(0, 3, "Remove");
// assemble Add Stock panel
addPanel.add(newSymbolTextBox);
addPanel.add(addButton);
// assemble main panel
mainPanel.add(stocksFlexTable);
mainPanel.add(addPanel);
mainPanel.add(lastUpdatedLabel);
// add the main panel to the HTML element with the id "stockList"
RootPanel.get("stockList").add(mainPanel);
// move cursor focus to the text box
newSymbolTextBox.setFocus(true);
}
}
Throwing an Nullpointer error as RootPanel.get("stockList") is null. I
checked all values for rootPanel variable as an HashMap, there is no
key pair for stockList element.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---