sclass dm_ReloadButton extends JLabel { O moduleID; *(fO *moduleID) { initImageLabel(this, #1101440); setToolTip(this, "Module can be reloaded"); onClick(this, r { removeFromParent(dm_ReloadButton.this); dm_reloadModule(moduleID); }); } } svoid dm_addReloadButtonToModuleTitlePane(O moduleID) { if (!usingJTattoo()) ret; // other L&F not tested final JComponent c = internalFrameTitleComponent((JInternalFrame) dm_frame(moduleID)); if (c == null) ret; if (containsChildWithShortName(c, 'dm_ReloadButton)) ret; final dm_ReloadButton btn = swingNu(dm_ReloadButton); final int nChildren = countChildren(c); final int w = preferredWidth(btn), h = preferredHeight(btn), gap = 5; addComponent(c, btn); final Runnable relayout = r { setBounds(btn, max(30, minXOfFirstNChildren(c, nChildren)-w-gap), (c.getHeight()-h)/2, w, h) }; final ComponentListener resizeListener = resizeListener(); bindToComponent(btn, r { c.addComponentListener(resizeListener); callF(relayout) }, r { c.removeComponentListener(resizeListener) }); }