【问题标题】:How to know programmatically the arrangement of two different screens connected in dual-screen mode?如何以编程方式知道以双屏模式连接的两个不同屏幕的排列?
【发布时间】:2021-11-14 04:22:56
【问题描述】:

当两个系统以双模式连接时,一个系统将成为默认系统,另一个系统将向右或向左延伸。

我想以编程方式找到它延伸到哪一侧。这是如何以编程方式找到的?

注意:我的应用在 Java 上运行,并且我已经试用了 GraphicsEnvironment 函数。

【问题讨论】:

    标签: java display multiple-monitors


    【解决方案1】:

    这样试试吧。

    GraphicsDevice[] g = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
             
    for ( GraphicsDevice gd : g) {
         System.out.println(gd.getDefaultConfiguration().getBounds());
    }
    

    边界应该代表屏幕彼此的相对位置。

    【讨论】:

    • 我想这可行,让我看看,并会在这里更新。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 2018-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多