How to set alignment in a JavaFX TextField?

人走茶凉 提交于 2021-01-03 06:36:56

问题


I need to set allignment of the text in a TextField to right. There is no such under TextField. Anybody knows how to set alignment in a textfield in javaFX 2.0 ?

Thanks


回答1:


In JavaFX 2.0, it may not have been possible, but it is in JavaFX 2.1 and ownward using the alignment property.

textField.setAlignment(Pos.CENTER_RIGHT);



回答2:


Currently It does not have a support on text field alignment. I reported this issue to javafx jira team and this feature will be added in version 2.1.

Here is the link. http://javafx-jira.kenai.com/browse/RT-18410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel



来源:https://stackoverflow.com/questions/8399026/how-to-set-alignment-in-a-javafx-textfield

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!