abstract sclass DynBigInputAndSections extends DynModule { S text; switchable int fontSize = 20; bool maximizeSingleSection = true; transient JPanel stack; transient Trigger trigger_makeSections = new(r makeSections); start { onChange(trigger_makeSections); } visual withComputing(trigger_makeSections, jvsplit(wrapTextArea(setFontSize(fontSize, dm_textArea('text))), jscroll_verticalExtend(stack = customLayoutPanel_trackWidth( nu StackLayouter(maximizeIfSingleComponent := maximizeSingleSection))))); JComponent wrapTextArea(JTextArea textArea) { ret textArea; } void makeSections() q { if (stack == null || !trigger_makeSections.check()) ret; removeAllComponents(stack); makeSections_impl(); print("Have sections: " + componentCount(stack)); print("Stack parent=" + getParent(stack)); } // override me. stack is already cleared. we're in the module queue void makeSections_impl {} // only call in makeSections_impl() void addSection(S name, Component contents) { addComponent(stack, jSection(name, contents)); } }