如何获得所有顶级窗口javafx? [英] How to get all top level window javafx?

查看:339
本文介绍了如何获得所有顶级窗口javafx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWT中看到了一个方法: java.awt.Window.getWindows()
在JavaFx中,是否有任何方法可以获取所有窗口JavaFx应用程序?

I saw a method in AWT: java.awt.Window.getWindows(). In JavaFx, is there any method to get all window JavaFx application?

谢谢,

推荐答案

AFAIK,仍然没有正确的方法来做到这一点。

AFAIK, there is still no proper way to do this.

虽然存在脏和短期方式:

浏览< a href =http://hg.openjdk.java.net/openjfx/8/master/rt/file/16e4c07f8562/javafx-ui-common/src/javafx/stage/Window.java>源代码 javafx.stage.Window ,有一个静态方法似乎可以达到你所期望的效果: javafx.stage.Window#impl_getWindows()

但是有一堆免责声明:

/**
 * Return all Windows
 *
 * @return Iterator of all Windows
 * @treatAsPrivate implementation detail
 * @deprecated This is an internal API that is not intended for use and will be removed in the next version
 */
@Deprecated
@NoInit
public static Iterator<Window> impl_getWindows() {
    final Iterator iterator = AccessController.doPrivileged(
        new PrivilegedAction<Iterator>() {
            @Override public Iterator run() {
                return windowQueue.iterator();
            }
        }
    );
    return iterator;
}

这篇关于如何获得所有顶级窗口javafx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆