当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Is there a way to turn off momentum (inertia) scrolling?

问题描述:

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];

        // ...
    }
分享给朋友:
您可能感兴趣的文章:
随机阅读: