It really depends what you are trying to do. If you are building an interface using standard GUI components, then it might make sense to use Swing. You can build good looking apps with Swing, and you can build ugly apps with JavaFX.
您真正的问题在于使用 NetBeans 平台。如果您还使用 NetBeans Windows 系统,那么将其与 JavaFX 结合起来就很困难。将场景添加到 JComponent 所需的 API 是私有的。但展望未来,我们一直在向 NetBeans 平台添加新功能。
Your real problems lies in using NetBeans platform. If you are using also NetBeans windows system then combining it with JavaFX is hard. The API needed to add Scene to JComponent is private. But look forward, we are always adding new features to NetBeans platform.
public void start(Stage s) throws Exception
{
// plug in custom windows and dockable panes.
FxDockFramework.setGenerator(new DemoPanes());
// load saved layout
int ct = FxDockFramework.loadLayout();
if(ct == 0)
{
// when no saved layout exists, open the first window
DemoWindow.openBrowser("https://github.com/andy-goryachev/FxDock");
}
}
public void start(Stage s) throws Exception
{
// plug in custom windows and dockable panes.
FxDockFramework.setGenerator(new DemoPanes());
// load saved layout
int ct = FxDockFramework.loadLayout();
if(ct == 0)
{
// when no saved layout exists, open the first window
DemoWindow.openBrowser("https://github.com/andy-goryachev/FxDock");
}
}
发布评论
评论(4)
这实际上取决于您想要做什么。如果您正在使用标准 GUI 组件构建界面,那么使用 Swing 可能会有意义。您可以使用 Swing 构建漂亮的应用程序,也可以使用 JavaFX 构建丑陋的应用程序。
It really depends what you are trying to do. If you are building an interface using standard GUI components, then it might make sense to use Swing. You can build good looking apps with Swing, and you can build ugly apps with JavaFX.
JavaFX 很好,你可以尝试一下。
它会给你的应用程序带来很酷的外观,但它有点重。
JavaFX is good you can try with it.
It will give your application cool look but its little bit heavy.
您真正的问题在于使用 NetBeans 平台。如果您还使用 NetBeans Windows 系统,那么将其与 JavaFX 结合起来就很困难。将场景添加到 JComponent 所需的 API 是私有的。但展望未来,我们一直在向 NetBeans 平台添加新功能。
Your real problems lies in using NetBeans platform. If you are using also NetBeans windows system then combining it with JavaFX is hard. The API needed to add Scene to JComponent is private. But look forward, we are always adding new features to NetBeans platform.
一个简单的JavaFX对接框架:
https://github.com/andy-goryachev/FxDock
A simple docking framework for JavaFX:
https://github.com/andy-goryachev/FxDock