ComboBox选项在阶段可调整大小时接收边距 [英] ComboBox options receive margin upon making the stage resizable
问题描述
我通过FXML在JavaFX Stage
中有一个 ComboBox
通常这是按预期工作。但是,一旦我通过 stage.setResizable(false);
使 ComboBox
I've got a ComboBox
within a JavaFX Stage
through FXML. Normally this works as expected. However, once I make the stage unresizable through stage.setResizable(false);
, the options of the ComboBox
receive a slight margin as seen below:
ComboBox
没有自定义样式,即使使用阶段
仅包含 comboBox ,可调整大小的选项会导致此效果。有没有办法防止这种情况发生,并保持选项与 ComboBox
始终对齐?
The ComboBox
has no custom styles and even when using a Stage
containing only the ComboBox
, the resizable option causes this effect. Is there any way to prevent this from happening and keeping the options aligned with the ComboBox
at all times?
推荐答案
尝试在Java 8(最新版本)上运行您的代码,并查看问题是否已解决。
Try running your code on Java 8 (latest current release version) and seeing if the issue is fixed for you.
:
JavaFX:为什么stage.setResizable(false)原因额外的利润?
和错误报告:
RT-36413:初始阶段大小对于不可调整大小的阶段设置不正确。
我不知道
您的错误可能与RT-36413具有相同的路由原因,但表现出某种程度的行为,我建议在 https://javafx-jira.kenai.com (确保您在新的错误报告中提及现有的RT-36413错误)。
Your bug likely has the same route cause as RT-36413, but exhibits somewhat behaviour, I suggest filing another bug report at https://javafx-jira.kenai.com (make sure you mention the existing RT-36413 bug in your new bug report).
这篇关于ComboBox选项在阶段可调整大小时接收边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!