Sometimes, when testing our applications, we need to deal with platform-specific issues. FEST-Swing provides the utility class
Platform to overcome this type of issues.
Platform provides one method,
controlOrCommandKey() that returns the code of either the "Command" key (if MacOS) or the code of the "Control" key (if other than MacOS, for example Windows.) A good example of the utility of this method is simulation of a user copying some text to the clipboard. In windows we need to simulate a user pressing the keys "Control" and "C," while in MacOS we need to simulate a user pressing the keys "Command" and "C." With FEST-Swing we can simple write: