在javafx中设置TableView列的水平对齐

时间:2018-08-07 07:16:06

标签: java javafx tableview

我想从右到左对齐TableView中的列,这意味着在TableView中将空格放置在列集的左侧而不是右侧。 我正在使用JFXTableView组件:

JFXTreeTableView<Person> table = new JFXTreeTableView<>();

JFXTreeTableColumn<Person, String> fNameColumn;
JFXTreeTableColumn<Person, String> lNameColumn;
JFXTreeTableColumn<Person, String> phoneColumn;

JFXTreeTableView<Person> table = new JFXTreeTableView<>();
TextField textFieldFirstNameController = new TextField();
TextField textFieldLastNameController = new TextField();
TextField textFieldPhoneNumberController = new TextField();
TextField textFieldProfilePhotoController = new TextField();

IntegerProperty selectedPersonId = new SimpleIntegerProperty();
StringProperty selectedPersonFName = new SimpleStringProperty();
StringProperty selectedPersonLName = new SimpleStringProperty();
StringProperty selectedPersonPhoneNumber = new SimpleStringProperty();
StringProperty selectedPersonProfilePhoto = new SimpleStringProperty();


TextField textFieldFirstName = new TextField();
TextField textFieldLastName = new TextField();
TextField textFieldPhoneNumber = new TextField();
TextField textFieldProfilePhoto = new TextField();

final TreeItem<Person> root = new RecursiveTreeItem<Person>(Persons, 
RecursiveTreeObject::getChildren);
    table.getColumns().setAll(phoneColumn, lNameColumn, fNameColumn);
    table.setRoot(root);
    table.setShowRoot(false);

enter image description here

0 个答案:

没有答案