JavaFX Tutorial 28 - HTMLEditor Java GUI

preview_player
Показать описание
JavaFX Tutorial 28 HTMLEditor Java GUI
Source Code:
@Override
public void start(Stage primaryStage) {
HTMLEditor htmlEditor = new HTMLEditor();
String htmlText = "?b? Code Amir?/b?";

VBox vBox = new VBox(htmlEditor);
Scene scene = new Scene(vBox);
}
Libraries Importing:

Рекомендации по теме
Комментарии
Автор

Hello,

Thanks for the video

I have a question concerning HTMLEditor.
I make 2 stages from SceneBuilder:
the first Stage contain a scene with only one button which open a new stage in a scene which contain a HTMLEditor component.

The HTMLEditor component has been created in SceneBuilder
I have 2 fxml file from these 2 stages
I have also a MainController with a field @FXML private HTMLEditor htmlEditor1;

In my fxml file(for the stage HTMEditor), i have

i don't want create a new instance (with 'new HTMLEditor()'), i'd would like only from

In event button from the first stage open the new Stage with HTMLEditor, it's ok but it's impossible to execute htmlEditor11.setHtmlText("my sentence");
I have a null pointer exception with setHtmlText method

My question ^^: How to resolve this problem ?
Thanks for your help

surfeurdestemps
Автор

hello, I would like, just for the practice, make a data binding between one or two textfields and HTMLEditor in a controller.

How to make this ?
@FXML
private TextField textfield1;

@FXML
private TextField textfield2;

private HTMLEditor htmleditor;

private SimpleStringProperty simple_string_property;

@Override
public void initialize(URL location, ResourceBundle resources) {
simple_string_property = new SimpleStringProperty();
World");

//
// Bindings.bindBidirectional(textfield1.textProperty(),
// textfield2.textProperty());

Bindings.bindBidirectional(textfield1.textProperty(), simple_string_property);

}
Thanks

surfeurdestemps
visit shbcf.ru