I've never did but take a look in HTML Editor (http://docs.oracle.com/javafx/2/ui_controls/editor.htm).How can I show in B$J a text area editor that allows bold, italic, etc. (much like the editor I am using to create this post).
Thanks in advance.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.HTMLEditor;
import javafx.stage.Stage;
public class HTMLEditorSample extends Application {
@Override
public void start(Stage stage) {
stage.setTitle("HTMLEditor Sample");
stage.setWidth(400);
stage.setHeight(300);
final HTMLEditor htmlEditor = new HTMLEditor();
htmlEditor.setPrefHeight(245);
Scene scene = new Scene(htmlEditor);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Use WebView instead of Label.OK, one more question. The editor returns HTML. Do we have a function that converts HTML to formatted text that we can put in, say, a label?