JGoSubGraph.setBorderPen(null)

JGoSubGraph.setBorderPen(null) throws a NullPointerException if there is no border pen before this call is made.

The javadoc states “a null value will cause no border to be drawn”. While this is true it is not quite satisfactory to have to catch the exception or do a call with a dummy pen before calling with null.

I think it is JGo 5.1 we are using.

BR,
Martin

Yes, you’re right. Thanks for pointing this out. We’ll fix that in the next release. In the meantime, you can either use your workaround or substitute the following code for the JGoSubgraph setBorderPen method (corrections in red):

public void setBorderPen(JGoPen p)
{
JGoPen old = myBorderPen;
if ((old == null && p != null) || (old != null && !old.equals(p))) {
myBorderPen = p;
update(ChangedBorderPen, 0, old);
}
}