JavaFX Text Selection background
问题 It is possible to set the fill for a selection area in a javafx.scene.text.Text . setFill(RED); However, there seems to be no equivalent setBackground(BLUE) public class Main extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { Pane p = new Pane(); Scene s = new Scene(p); s.getStylesheets().add("main.css"); primaryStage.setScene(s); primaryStage.show(); addTextWithSelection(p); } private void