我正在尝试在我的应用程序中创建一个NotePad屏幕。创建便笺后,便会将其锁定且无法编辑,但可以将新页面添加到便笺。
我认为使用TextFlow可以很好地控制这一点。我想做的事情如下:
**Note Taker Name**
**Date of Note**
Line of Note Text
Line of Note Text
Line of Note Text
Line of Note Text
------------------------------------------
**Note Taker Name**
**Date of Note**
Line of Note Text
Line of Note Text
Line of Note Text
Line of Note Text我尝试过这样做:
String s1 = "line of text";
textFlow.getChildren().add(new Text(s1));
textFlow.getChildren().add(new Text(System.lineSeparator()));
textFlow.getChildren().add(new Separator(Orientation.HORIZONTAL));
textFlow.getChildren().add(new Text(System.lineSeparator()));
textFlow.getChildren().add(new Text(s1));
scrollPane.setFitToWidth(true);这为我提供了我想要的东西,除了分隔符只是一小行。我希望这条线跨越整个TextFlow,但我真的不确定该怎么做。
谢谢。
https://stackoverflow.com/questions/38101927
复制相似问题