Mark
Mark

Reputation: 2227

Can't set border to ToggleButton in GluonMobile

Using GluonMobile, I tried

Border RED_BORDER = new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, null, null));

var toggleButton = new ToggleButton("text");
toggleButton.setBorder(RED_BORDER);

But this doesn't do anything. I looked in ScenicView and the border is blue just like I see in the app.

If i bind instead

toggleButton.borderProperty().bind(new SimpleObjectProperty<>(RED_BORDER));

than it works, but I can't bind it right now.

How is it working with binding and not with setting? Can I solve this outisde of CSS?

Upvotes: 0

Views: 26

Answers (0)

Related Questions