在 javafx 中使用 Swing 组件(如果它们不在 NetBeans javafx 调色板中)

发布于 2024-07-14 15:06:58 字数 414 浏览 3 评论 0原文

我刚刚开始在 NetBeans 中使用 javafx,我让它做简单的事情(带有按钮的窗口等),但想尝试一些更实际的东西。

“Swing/AWT Components”面板有一大堆“JavaFX Script Code Clips”面板没有的东西(它有 Button、CheckBox、ComboBox、ComboBoxItem、Label、RadioButton、Slider、TextField 和 ToggleButton)。 如何向此调色板添加内容?

我想尝试使用 org-netbeans-swing-outline.jar 中的一些组件


编辑:啊哈。 我有点忽略了这一点:javafx.ext.Swing.* 中只有一些 javafx 包装的 Swing 组件可用,因此如果您想要其他 Swing 组件之一,则必须自己包装它们。

I'm just getting started with javafx in NetBeans, and I have it doing simple stuff (windows with buttons + the like) but would like to try something slightly more realistic.

The "Swing/AWT Components" palette has a whole bunch of stuff that the "JavaFX Script Code Clips" palette does not (it has Button, CheckBox, ComboBox, ComboBoxItem, Label, RadioButton, Slider, TextField, and ToggleButton). How do I add stuff to this palette?

I would like to try using some of the components in org-netbeans-swing-outline.jar


edit: Aha. I was missing the point somewhat: there are only some javafx-wrapped Swing components available in javafx.ext.Swing.*, so if you want one of the other Swing components you have to wrap them yourself.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最偏执的依靠 2024-07-21 15:06:58

啊哈,我想出了我需要做什么:

有一种方法可以 将 Swing 组件包装到 javafx 组件中使用javafx.ext.swing.SwingComponent.wrap()

aha, I figured out what I needed to do:

There's a way to wrap Swing components into a javafx component using javafx.ext.swing.SwingComponent.wrap()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文