当前位置: 动力学知识库 > 问答 > 编程问答 >

java - ComboBox options receive margin upon making the stage resizable

问题描述:

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:

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?

网友答案:

Try running your code on Java 8 (latest current release version) and seeing if the issue is fixed for you.

See related question: JavaFX: Why does stage.setResizable(false) cause additional margins?

And bug report: RT-36413: Initial stage size set incorrectly for non-resizable stages.

I don't know of a clean workaround for your case.

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).

分享给朋友:
您可能感兴趣的文章:
随机阅读: