NullPointerException in FontDesignMetrics$MetricsKey.init when using Netbeans Visual Library
If you’re getting a NullPointerException stacktrace like the one below while using the Netbeans Visual Library to create your own GraphScene, check that your adding your widgets propertly to scene. A good idea is to use LayerWidgets, declaring them in the constructor of your GraphScene: mainLayer = new LayerWidget(this); addChild(mainLayer); connectionLayer = new LayerWidget(this); addChild(connectionLayer); and then add the widgets to those layers in attachNodeWidget and attachEdgeWidget: @Override protected Widget attachNodeWidget(String node) { LabelWidget w = new LabelWidget(this, node); w.setBorder(BORDER4); w.getActions().addAction(createSelectAction()); w.getActions().addAction(createObjectHoverAction()); w.getActions().addAction(ActionFactory.createMoveAction()); this.mainLayer.addChild(w); return w; } @Override protected Widget attachEdgeWidget(String edge) { ConnectionWidget w = new ConnectionWidget(this); w.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED); this.connectionLayer.addChild(w); return w; } The stacktrace: ...