问题描述:

Is there a way to turn off momentum scrolling (scrolling with inertia) in a Java Swing application?

This guide demonstrates how to do it for a Cocoa application

Adding "AppleMomentumScrollSupported" to my Info.plist had no effect.

Any thoughts on how to achieve this in a Swing app?

网友答案:

It is possible to do this in Java 7, but you need to fork Oracle's appbundler and edit native/main.m which compiles into JavaAppLauncher:

    int main(int argc, char *argv[]) {
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:@"NO" 
            forKey:@"AppleMomentumScrollSupported"];
        [defaults registerDefaults:appDefaults];

        // ...
    }
相关阅读:
Top