How to make BoxArea with handle and collapsed obj

BoxArea extends JGoSubGraphBase, which has no handle and collapsed object.
I edited BoxApp (from 5.2 examples) so that BoxArea extends JGoSubGraph
After run:
java.lang.NullPointerException
at com.nwoods.jgo.JGoSubGraph.computeBoundingRect(JGoSubGraph.java:427)
at com.nwoods.jgo.JGoObject.setBoundingRect(JGoObject.java:450)
at com.nwoods.jgo.examples.boxapp.BoxApp.init(BoxApp.java:86)
at com.nwoods.jgo.examples.boxapp.BoxApp.main(BoxApp.java:57)

Is there a reason you don’t just use a JGoSubGraph instead of the example BoxArea?

I haven't tried this, but you should be able to adopt the BoxView class to apply to JGoSubGraphs instead of to BoxAreas, if that is behavior you are looking for.

[QUOTE=walter]

Is there a reason you don't just use a JGoSubGraph instead of the example BoxArea?
[/quote]
1) I need roundrect-dashed-border as BoxArea has.
2) JGoSubGraph.setLocation() throws Exception and computes self bounds from bounds of child objects. In my case group object can exist without inner nodes with its own location.
[QUOTE=walter]
I haven't tried this, but you should be able to adopt the BoxView class to apply to JGoSubGraphs instead of to BoxAreas, if that is behavior you are looking for.
[/quote]
Yes, I'm looking for exactly so behavior
but JGoSubGraph stretches when inner object moves off subgraph bounds. Is it possible to move off a node from JGoSubgraph?

For (1) you just need to set the BorderPen of the JGoSubGraph, just as BoxArea does to the JGoRoundRect that it uses. But if you want to change the derivation of BoxArea, that won’t be necessary.

The computeBorder that BoxArea defines is unrelated to the computeBorder that JGoSubGraph defines. But they happen to have the same signature, so by changing the inheritance one method is now overriding an unrelated method.
So if you want to do this, you'll need to rename that method in BoxArea. You'll also want to override JGoSubGraph.computeBorder to just return the bounding rectangle of the BoxArea's border JGoRoundRect -- i.e. just return getBorder().getBoundingRect().

OK, I’ll try it.

Thank you