!7 module CurrentAction { transient JPanel stack; visualize { ret stack = dynamicVStack2(); } // API // Note: cancelMe will be called in GUI thread AutoCloseable showAction(S action, Runnable cancelMe) { final JComponent c = centerAndEast(jlabel(action), jbutton("Cancel", cancelMe)); stack.add(c); ret autoCloseable { removeComponent(stack, c); }; } }