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_reloadModuleInBackground(moduleID); }); } } // tested with JTattoo and Windows L&F sbool dm_addReloadButtonToModuleTitlePane(fO moduleID) { ret swing(func -> bool { final JComponent c = internalFrameTitleComponent((JInternalFrame) dm_frame(moduleID)); if (c == null) false; if (containsChildWithShortName(c, 'dm_ReloadButton)) false; final dm_ReloadButton btn = swingNu(dm_ReloadButton, moduleID); addBottomMargin(btn, 2); 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_rightOf(c, nChildren, 20)-w-gap), (c.getHeight()-h)/2, w, h) }; final ComponentListener resizeListener = resizeListener(relayout); bindToComponent(btn, r { c.addComponentListener(resizeListener); callF(relayout) }, r { c.removeComponentListener(resizeListener) }); vmBus_send('addedReloadButtonToModule, moduleID); true; }); }