I am trying to create a pane containing a label and having various buttons on its border. I am new to JavaFx and I do not know if the way I used is the best, however I doubt it since I encounter a problem where the buttons are not clickable in the inner part of the pane, but only in the outer part...
<StackPane>
<StackPane styleClass="name-box">
<Label text="Margherita"/>
<padding>
<Insets bottom="20.0" left="80.0" right="80.0" top="20.0" />
</padding>
</StackPane>
<HBox alignment="TOP_CENTER" spacing="20.0">
<Button fx:id="bonus1" styleClass="bonus-button"/>
<Button fx:id="bonus2" styleClass="bonus-button"/>
<Button fx:id="bonus3" styleClass="bonus-button"/>
<Button fx:id="bonus4" styleClass="bonus-button"/>
<StackPane.margin>
<Insets top="-12.0" />
</StackPane.margin>
</HBox>
<HBox alignment="BOTTOM_CENTER" spacing="40.0">
<Button/>
<Button/>
<StackPane.margin>
<Insets bottom="-12.0" />
</StackPane.margin>
</HBox>
</StackPane>
.name-box {
-fx-border-color: #00FFFF;
-fx-border-width: 2px;
-fx-effect: dropshadow(gaussian, #00FFFF, 15, 0.3, 0, 0);
}
.bonus-button {
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, #5ff7c2, #26CB95);
-fx-background-radius: 10;
-fx-cursor: hand;
}
I tried with pickOnBounds="false" and mouseTransparent="true" on the StackPane but nothing... Any advice?
