scope stefansOS_loadingAnimation. sS #text = "Stefan's OS loading"; sS #animationID = #1101279; static JFrame stefansOS_loadingAnimation(final Runnable onStop) { print("[loading animation]"); final JLabel label = jcenteredlabel(text); final JButton stopButton = jbutton(upper("Press space to stop"), r { disableButton(); //setText(heldInstance(JButton), "Stopping..."); setText(label, "STOPPING"); callF(onStop); }); logMechListAppendLocally("Animations shown", animationID); JPanel panel = jBackground(Color.black, centerAndSouth(centerAndSouth( withMargin(50, jimage(animationID)), withMargin(20, 40, 0, 40, setForeground(Color.white, setFont(#1011145, 60, label)))), withMargin(20, jcenteredline(stopButton)))); ret onWindowClosingOnly(showCenterPackedFrame(text, panel), rClickButton(stopButton)); } end scope