Creating a new JGoLayer

Hi all,
How can I create a new JGoLayer… Actually, I have to store a number of JGoLayer objects in a HashMap and send it somewhere. In the receiving end, they will unbundle it and use it…Can somebody help??

JGoDocument.addLayerAfter or addLayerBefore.

The addLayerAfter() and addLayerBefore() methods expect a layer object right?? “How can I create them??”, is my question…

[QUOTE=Nanda Kumar]The addLayerAfter() and addLayerBefore()
methods expect a layer object right?? “How can I create
them??”, is my question…[/quote]

Good question, cause looking at the JavaDocs gives this for JGoDocument:

JGoLayer addLayerAfter(JGoLayer old)
     &nbs p;Create a new empty layer and add it to this document just in

front of the given layer.

JGoLayer addLayerBefore(JGoLayer old)
     &nbs p;Create a new empty layer and add it to this document just behind

the given layer.

Looks straight forward but then have a look at JGoLayer:

Constructor Summary

JGoLayer()

     &nbs p;Don't use

this constructor–instead call JGoDocument.addLayerAfter or
JGoDocument.addLayerBefore.

Every document has at least one layer. For example, in Demo1.java:
myMainLayer = myDoc.getFirstLayer();
myForegroundLayer = myDoc.addLayerAfter(myMainLayer);
myForegroundLayer.setIdentifier(“in foreground layer”);
There are also JGoDocument.getDefaultLayer() and getLastLayer().