Javafx不接受文本字段的textArea中的其他字体或语言


import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import javafx.scene.control.*;
public class textareasss extends Application {
@Override
public void start(Stage stage) throws Exception {
GridPane p = new GridPane();
TextArea tx= new TextArea();
p.add(tx,0,0);

Scene sce = new Scene(p,600,600);
stage.setScene(sce);
stage.show();
}
}

链接到屏幕截图

每次我在javafx text Area或TextField中粘贴文本时,文本都不会显示,而是像这样的符号:????。

我运行了您的代码,它正常工作,JavaFX不接受字体或语言没有错

这就是我使用的:

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage stage) throws Exception{
GridPane gridpane = new GridPane();
TextArea text= new TextArea();
gridpane.add(text,0,0);
Scene scene = new Scene(gridpane,600,600);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}

这是我得到的输出:

文本区域包含多种语言的文本

最新更新