Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javafx html editor

actually i'm looking for something very similar to this thread:

How to hide the controls of HTMLEditor?

so basically i try to add a custom button to the javafx html editor but with the difference that it's implemented through FXML.

So my question is:

Is there a "work-around" to add custom buttons to the html-editor when it's implemented through FXML?

like image 485
fraggle Avatar asked Jan 14 '23 23:01

fraggle


1 Answers

Sample solution is :

htmlEditor.setVisible(false);
    Platform.runLater(new Runnable() {

        @Override
        public void run() {
            Node[] nodes = htmlEditor.lookupAll(".tool-bar").toArray(new Node[0]);
            for (Node node : nodes) {
                node.setVisible(false);
                node.setManaged(false);
            }
            htmlEditor.setVisible(true);
        }

    });
like image 63
hkg Avatar answered Jan 22 '23 17:01

hkg