My solution wouldn't have worked for applets of course (my bad). But the solution you came up with is brilliant my friend