How can i set border color to an Avatar object in javafx? How many ways exists to do it?
It's not just css mode, also by code. The object i want to set border color is this:
http://docs.gluonhq.com/charm/javadoc/3.0.0/com/gluonhq/charm/glisten/control/Avatar.html
Thanks in advance
The custom control Avatar
from the Gluon Mobile library has API for setting the image and the radius.
Currently it doesn't provide API for setting the border color, but it can be done, based on how the control is designed.
If you check it with ScenicView, the control has an ImageView
and a Circle
on top, with styleClass decoration
.
So by code you can set the color of this circle:
avatar.getChildrenUnmodifiable().get(1).setStyle("-fx-stroke: red");
or better:
avatar.lookup(".decoration").setStyle("-fx-stroke: red");
With CSS is easier:
.avatar > .decoration {
-fx-stroke: red;
}