Dears:
Because my first JavaBean will use JGraph,
I modified by the sample from http://www.jgraph.com/faq.html?show=3.2
help me the "error message"
//select.jsp, not whole code
Selected nodes F<input type="text" name="NODE">
<input type="submit" name="run" value="Select">
//view.jsp, not whole code
<!-- For JavaBeans -->
<jsp:useBean id="JGraph" class="bean.GraphLayout" />
<jsp:setProperty name="GraphLayout" property="*" />
<jsp:getProperty name="GraphLayout" property="*" />
//Graphlayout.java
package bean;
...//omit some import,
public class GraphLayout {
private String NODE;
public static void main(String[] args) {
...// omit some code about JGraph,
public String getNODE(){
return NODE;
}
public void setNODE(){
this.NODE=NODE;
}
// Create a Vertex, NODE get from select.jsp
cells[0] = createVertex( NODE, 20, 20, 40, 20, null, false);
...// omit some code about JGraph,
}
public static DefaultGraphCell createVertex(String name, double x,
double y, double w, double h, Color bg, boolean raised) {
...// omit some code about JGraph,
}
{color:#ff0000}//error message
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "String", @ expected
getNODE cannot be resolved to a type
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement
Syntax error on token "void", @ expected
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement
at bean.GraphLayout.main(GraphLayout.java:40){color}
Thanks
Edited by: mjl on Nov 29, 2008 10:42 PM