/** * Copyright (c) 2008, 2011 Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. */ import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.web.HTMLEditor; /** * A sample that demonstrates the HTML Editor. You can make changes to the * example text, and the resulting generated HTML is displayed. * * @related controls/text/SimpleLabel * @see javafx.scene.web.HTMLEditor */ public class HTMLEditorSample1 extends Application { private HTMLEditor htmlEditor = null; private final String INITIAL_TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +"Nam tortor felis, pulvinar in scelerisque cursus, pulvinar at ante. Nulla consequat " + "congue lectus in sodales. Nullam eu est a felis ornare bibendum et nec tellus. " + "Vivamus non metus tempus augue auctor ornare. Duis pulvinar justo ac purus adipiscing " + "pulvinar. Integer congue faucibus dapibus. Integer id nisl ut elit aliquam sagittis " + "gravida eu dolor. Etiam sit amet ipsum sem."; @Override public void start(Stage stage) { htmlEditor = new HTMLEditor(); htmlEditor.setPrefSize(600, 245); //htmlEditor.setHtmlText(INITIAL_TEXT); stage.setResizable(false); stage.setScene(new Scene(htmlEditor, 620,260)); stage.show(); } public static void main(String[] args) { launch(args); } }