【发布时间】:2014-12-14 07:45:29
【问题描述】:
我有一个用 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);
}
}
【问题讨论】:
-
谢谢大佬,很高兴帮你解决问题:)