static AutoCloseable tempAddComponentInFront(Container a, Component b) { if (a == null || b == null) null; swing { if (b.getParent() == a) null; addComponentInFront(a, b); ret -> swing { if (b.getParent() == a) removeFromParent(b); }; } }