I am new to JavaFX. In my application, I am using the Titled pane, and I want to replace the location of the default minimization icon from left to right. The fact is that I use a separate FXML file for the title bar, and it is included in the scene. I used the content below css to achieve my goal.
.titled-pane > .title > .arrow-button .arrow {
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.25em 0.3125em 0.25em 0.3125em;
-fx-collapsible: false;
-fx-shape: "";
First I tried to remove the icon using the above css.
public class PrjExplorerController implements Initializable {
@FXML
TitledPane titledPanePrjExplorer;
@Override
public void initialize(URL url, ResourceBundle rb) {
titledPanePrjExplorer.getStylesheets().add("StyleSheet.css");
boolean b = titledPanePrjExplorer.getStyleClass().add("titled-pane");
}
}
But that does not work. I think I'm using the wrong approach. Can someone help me with this?
source
share