JavaFX 和 CSS Basic(关于复选框)
我有几个关于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您读过《JavaFX CSS 参考指南》吗?
http ://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html
Have you read the JavaFX CSS Reference Guide?
http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html
我认为您需要查看的地方是这个论坛帖子:
我对 ListBox 也有类似的问题,其中控件由许多组件构造而成,并且有一堆不同的伪类可以根据您的需要进行“配置”。
设置复选框样式 线程会将您指向 javaFX 运行时:$lib\ext\jfxrt.jar 。
如果您查看:com/sun/javafx/scene/control/skin/
您将获得控件的完整裸“默认”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/
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