import javax.swing.border.*; sclass jCenteredLiveValueSection_class extends SingleComponentPanel { IGetterWithNotify liveValue; settable int borderType = BevelBorder.LOWERED; settable bool bold; S getTitle() { ret liveValue!; } *(IGetterWithNotify *liveValue, Component c) { super(c); } selfType init() { bindLiveValueListenerToComponent(this, liveValue, r-awt { var titledBorder = BorderFactory.createTitledBorder( makeBaseBorder(), liveValue!); if (bold) titledBorder.setTitleFont(deriveBoldFont(getFont())); setBorder(titledBorder); centerSection(jCenteredLiveValueSection_class.this); revalidate(); }); this; } swappable Border makeBaseBorder() { ret BorderFactory.createBevelBorder(borderType); } } static JPanel jCenteredLiveValueSection(IGetterWithNotify lv, Component c) swing { ret new jCenteredLiveValueSection_class(lv, c).init(); }