Community
Participate
Working Groups
FlowPage page = new FlowPage(); TextFlow text = new TextFlow(); page.add(text); text.setLayoutManager(new ParagraphTextLayout(text)); text.setText("some text"); page.setFont(new Font(null, "Tahoma", 8, 0)); page.setSize(100, 30); page.validate(); The NPE will be encountered during page.validate() because the text flow's new layout's context is null. I think this is an unnecessary restriction on the user of Draw2d and we can fix this by caching the context in the FlowFigure instead of the FlowFigureLayout. The layout can then just get it from the figure.