sclass JNavigation extends JPanel { JList list; SingleComponentPanel scp; Map> contentMakers = synchroMap(); S lastItem; *() { makeFakeSingleComponentPanel(this, jhsplit(list, scp)); onSelectionChangedAndNow(list, voidfunc(S item) { if (eq(item, lastItem)) ret; lastItem = item; JComponent content = pcallF(contentMakers.get(item)); if (content == null) content = jcenteredimage(#1101244); scp.setComponent(content); }); } void addPage(fS name, JComponent content) { addPage(name, f0_const(content)); } void addPage(fS name, final F0 makeContent) { swing { contentMakers.put(name, makeContent); addListItem(list, name); } } }