Transpiled version (7066L) is out of date.
sclass SingleComponentPanel extends JPanel { *() { super(new BorderLayout); } *(Component component) { this(); if (component != null) setComponent(component); } void set(Swingable component) { set(wrap(component)); } void setComponent aka set(Component component) { swing { if (getComponent() == component) ret; removeAll(); if (component != null) add(BorderLayout.CENTER, wrap(component)); _revalidate(SingleComponentPanel.this); } } // Sometimes we need this? void setComponentAndRevalidateParent(Component component) { setComponent(component); _revalidate(_getParent(this)); } void noComponent aka clear() { setComponent(null); } Component getComponent aka get() { ret swing( -> getComponentCount() == 0 ? null : getComponent(0)); } bool isEmpty() { ret getComponent() == null; } bool hasComponent() { ret getComponent() != null; } }
download show line numbers debug dex old transpilations
Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment