JavaFX在场景中嵌入场景 [英] JavaFX embed scene in scene

查看:236
本文介绍了JavaFX在场景中嵌入场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用javafx场景渲染的应用程序,我想将该渲染放入我制作的GUI中,也就是在javafx中。我该怎么办?

I have an application that uses a javafx Scene to render something, and I want to put that rendering into some GUI that I made, also in javafx. How would I do that?

基本上有一些容器我可以将场景放入然后将该容器放入GUI中。

Basically is there some container I can put a scene into and then put that container into the GUI.

很抱歉,如果这是一个新手问题,我是JavaFX的新手

Sorry if it's a newbie question, I am new to JavaFX

推荐答案

该场景只有一个顶级父节点作为根。你可以得到它并放入另一个场景。

The scene has only a top parent node as a root. You can get it and to put into another scene.

((Pane) scene2.getRoot()).getChildren().add(scene1.getRoot());

这篇关于JavaFX在场景中嵌入场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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