JavaFX 和 CSS Basic(关于复选框)

发布于 2024-09-24 05:59:30 字数 155 浏览 1 评论 0原文

我有几个关于 JavaFX (1.3) 和 CSS 的问题。首先,当我创建一个 CheckBox 节点并设置其样式类时,我实际上无法显示该复选框。它看起来就像一个文本标签。我是否必须指定特定的内容才能实际显示复选框?

另外,我用来修改程序中所有复选框的 CSS 类/id 是什么?

I have a couple questions regarding JavaFX (1.3) and CSS. First of all, when I create a CheckBox node and set its styleclass, I can't actually get the checkbox to show up. It just looks like a text-label. Do I have to specify something specific to actually get the checkbox to appear?

Also, what is the CSS class/id I would use to modify all checkboxes in a program?

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

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

发布评论

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

评论(2

浪荡不羁 2024-10-01 05:59:30

我认为您需要查看的地方是这个论坛帖子:

我对 ListBox 也有类似的问题,其中控件由许多组件构造而成,并且有一堆不同的伪类可以根据您的需要进行“配置”。

设置复选框样式 线程会将您指向 javaFX 运行时:$lib\ext\jfxrt.jar 。

如果您查看:com/sun/javafx/scene/control/skin/

  • caspian/caspian.cssmoderna
  • /moderna.css,

您将获得控件的完整裸“默认”CSS。也就是说,我今天来这里是为了找出

...如何对齐文本基线,因此在它神奇地看起来正确之前还有很多工作要做哈哈

I think the place you need to look at is this forum post:

I had similar issues with ListBox where the control is constructed from a number of components and has a bunch of different pseudo classes to be 'configured' depending on what you need it do look-like.

The Styling a checkbox thread points you to the javaFX runtime: $lib\ext\jfxrt.jar.

If you look in: com/sun/javafx/scene/control/skin/

  • caspian/caspian.css
  • moderna/moderna.css

You get the full naked 'defaults' CSS for the your controls. That said I am on here today to find out

... how to align the text base-line, so there's still work to do before it just magically looks right lol

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