Javafx从htmleditor中删除节点

Javafx从htmleditor中删除节点,java,html,css,javafx,Java,Html,Css,Javafx,我用javafx开发了一个简单的应用程序。问题是,我想删除两个工具栏,但没有办法做到这一点。在代码中,我将底部工具栏的可见性设置为false。 如需帮助,请回答:顶部工具栏的id为.top toolbar,而底部工具栏的id为.bottom toolbar。非常感谢你的帮助。。。这是我的密码。 提前谢谢 import javafx.application.Application; import javafx.scene.Node; import javafx.scene.Scene; impor

我用javafx开发了一个简单的应用程序。问题是,我想删除两个工具栏,但没有办法做到这一点。在代码中,我将底部工具栏的可见性设置为false。 如需帮助,请回答:顶部工具栏的id为.top toolbar,而底部工具栏的id为.bottom toolbar。非常感谢你的帮助。。。这是我的密码。 提前谢谢

import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.web.HTMLEditor;
import javafx.stage.Stage;

public class PrivateHistory 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);
        Node node = htmlEditor.lookup(".bottom-toolbar");
        node.setVisible(false);
        //htmlEditor.setHtmlText("<img src='"+getClass().getResource("ball.png")+"' />");
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
} 
导入javafx.application.application;
导入javafx.scene.Node;
导入javafx.scene.scene;
导入javafx.scene.web.HTMLEditor;
导入javafx.stage.stage;
公共类PrivateHistory扩展了应用程序{
@凌驾
公众假期开始(阶段){
stage.setTitle(“HTMLEditor示例”);
舞台布景宽度(400);
舞台设置高度(300);
最终HTMLEditor HTMLEditor=新HTMLEditor();
htmlEditor.setPrefHeight(245);
场景=新场景(htmlEditor);
舞台场景;
Node Node=htmlEditor.lookup(“.bottom toolbar”);
node.setVisible(false);
//htmlEditor.setHtmlText(“”);
stage.show();
}
公共静态void main(字符串[]args){
发射(args);
}
} 

htmlEditor上应用以下代码

    htmlEditor.lookup(".top-toolbar").setManaged(false);
    htmlEditor.lookup(".top-toolbar").setVisible(false);

    htmlEditor.lookup(".bottom-toolbar").setManaged(false);
    htmlEditor.lookup(".bottom-toolbar").setVisible(false);

htmlEditor上应用以下代码

    htmlEditor.lookup(".top-toolbar").setManaged(false);
    htmlEditor.lookup(".top-toolbar").setVisible(false);

    htmlEditor.lookup(".bottom-toolbar").setManaged(false);
    htmlEditor.lookup(".bottom-toolbar").setVisible(false);

谢谢老兄,我很高兴帮你解决问题:)谢谢老兄,我很高兴帮你解决问题:)