Delete all toolbar buttons from JavaFX HTMLEditor , just only input area, what can display html-code. - Java JavaFX

Java examples for JavaFX:HTMLEditor

Description

Delete all toolbar buttons from JavaFX HTMLEditor , just only input area, what can display html-code.

Demo Code


    //package com.java2s;

    import javafx.application.Platform;
    import javafx.scene.Node;

    import javafx.scene.web.HTMLEditor;

    public class Main {
        /**//from   ww w .  j  av a 2  s  . co m
         * Delete all toolbar buttons from {@link HTMLEditor}, just only
         * input area, what can display html-code.
         * @param editor
         */
        public static void hideHTMLEditorToolbars(final HTMLEditor editor) {
    editor.setVisible(false);
    Platform.runLater(() -> {
        Node[] nodes = editor.lookupAll(".tool-bar").toArray(new Node[0]);
        for (Node node : nodes) {
            node.setVisible(false);
            node.setManaged(false);
        }
        editor.setVisible(true);
    });
}
    }

Related Tutorials