文本对象未显示在 javafx 场景窗口对象中

问题描述

我的项目中有一个extends Application 类,当我运行该程序时,它会绘制窗口,但没有在其内容窗格中按预期显示文本。这是我尝试过的...

    @Override
    public void start(Stage stage) throws Exception {
       // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods,choose Tools | Templates.
     stage.setTitle("Web Crawler");
     Text mytext= new Text("Output will show up here");
     //Create a new Spider object and then call method to return strin
     mytext.setText("My name is professional programmer");
     mytext.setVisible(true);
     Group root= new Group();
     root.getChildren().add(mytext);
       stage.setScene(new Scene(root));
      stage.show();
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)