textflow

JavaFX TextFlow set default text color

[亡魂溺海] 提交于 2020-01-25 07:59:43
问题 As the title, it's possible to to apply a default color to all text of a TextFlow component? TextFlow textFlow = new TextFlow(); textFlow.setId("supertextflow"); // Somewhere else in the code textFlow.getChildren() .add(new Text("Dynamic added text! OMG!")); I tryed different solution but none of them works #supertextflow { -fx-text-fill: red; } #supertextflow * .text{ -fx-fill: red; } #supertextflow > * > .text { -fx-fill: red; } I know that Text is another component, but why i can't style

JavaFX: setting background color for Text controls

笑着哭i 提交于 2020-01-23 08:33:32
问题 I'm using a TextFlow and some Text items to show a styled text, but i cant find a way to set a simple background color for the Text items. I can set the fill color and font but it does not have a java method or css property that sets its background color. 回答1: Based on this solution, this is a quick implementation of a method to provide background coloring for all the Text nodes within a FlowPane , using CSS and the ability to set a series of paint values separated by commas (as much as Text

Textflow inside Tablecell: not correct cell height

旧时模样 提交于 2020-01-23 02:38:18
问题 I wont to place formated text inside a JavaFX table. First I was trying to embedd a Webview but I had problems with cell heigh. This seems to be a mission feature in JavafX (see: Java FX: TableView - display simple HTML). Based on the recommendation here I tried to embed a TextFlow. However again the sizing of the TabelCell is not correct. I want the height of the row just as big, that the content of the cell fits inside. Changeing the column width should result in changeing the row heigth.

JavaFX TableView with highlighted text

倾然丶 夕夏残阳落幕 提交于 2019-12-12 17:19:35
问题 I want to highlight parts of text displayed in a JavaFX TableView . Till now i'm using Text objects in TextFlow objects. To highlight specific parts in a text i am using tags to cut the text in parts ( javafx.scene.text objects) to highlight or not to highlight with the following code. col3.setCellValueFactory(new PropertyValueFactory<RegexMatch, String>("text")); col3.setCellFactory(new Callback<TableColumn, TableCell>() { @Override public TableCell call(TableColumn param) { TableCell cell =