问题
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