setIcon recreates the frame without preserving the current frame's invert status (which is arguably a bug, but button is so ubuquitous that I dare not touch that behavior...). So, instead, rely on the rarely used preselect flag to preserve it.
pairs