Reputation: 1894
I want to loop through each object of a list. For each entry I want to create a GUI object that looks like this:
My problem is, that each label has a different length and it looks rather strange if not all pictures are on the same line (as seen vertically). Is there a possibility by either java
or css
to align the ImageVew
in center of the HBox
?
imageView.setLayoutX(filterBox.getWidth()/2);
didn't do the trick unfortunatly. And no -fx-align: right;
or -fx-float: right;
seems to be existing.
I included what I have so far.
VBox filtersBox = new VBox();
HBox filterBox;
for(Filter filter : filters.getFilters()){
if(!filter.isComplex()){
filterBox = new HBox();
filterBox.getStyleClass().add("filter");
ImageView imageView = new ImageView();
[image view stuff]
final CheckBox cbox = new CheckBox(filter.getName().toString());
filterBox.getChildren().addAll(cbox, imageView);
filtersBox.getChildren().addAll(filterBox);
}
}
Upvotes: 0
Views: 700