Use only the methods available in 1.5.
The modality extension is specific to
Java 1.6, it is not available in earlier releases. Not only the methods are missing in the API, the other needed library code is simply not there. If your application needs these new modes, it cannot be run on 1.5.
Maybe your application might
test the JRE version and use the 1.6 features only when available, disallowing or limiting functions that cannot be fully implemented in 1.5; however, I've no idea how - or whether at all - is this doable.