简体   繁体   English

如何从 Java Swing 应用程序中识别显示器?

[英]How to identify the monitor from Java Swing application?

I wrote a swing application for my clients and some of them are using multiple monitors.我为我的客户编写了一个 swing 应用程序,其中一些正在使用多个监视器。 Unfortunately that Java Swing application is confused in environment where multiple monitors present and pop up window appear in either first or second window.不幸的是,Java Swing 应用程序在存在多个监视器并弹出 window 出现在第一个或第二个 window1 或第二个 Z05B4B8C735CBDDZ902C 的环境中感到困惑。 How can I identify that client has multiple monitors and force application to show up consistently on one monitor?如何识别客户端有多个监视器并强制应用程序始终显示在一个监视器上?

  1. To detect number of screens, use GraphicsEnvironment.getScreenDevices() .要检测屏幕数量,请使用GraphicsEnvironment.getScreenDevices()
  2. To specify the monitor, either refer to this question , or the example in the GraphicsDevice API.要指定显示器,请参阅此问题GraphicsDevice API 中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM