javafx - JavaFX| .setWrapText() 不在 TextArea 中换行
问题描述
我有一个 TextArea 控件,我正在尝试使文本换行,无论我是在输入文件还是将文件内容加载到其中,都换行。我的.setWrapText()
电话打不通,我不确定为什么。我的组件结构是Tab>BorderPane>TextArea
,这就是我创建控件的方式:
Tab newTab = new Tab("New File ");
BorderPane borderPane = new BorderPane();
JFXTextArea mainText = new JFXTextArea();
mainText.prefWidthProperty().bind(borderPane.widthProperty()); //found this somewhere online earlier been on this the whole day and I cant seem to pinpoint the link exactly
mainText.setWrapText(true);
borderPane.setCenter(mainText);
newTab.setContent(borderPane);
我怎样才能解决这个问题?
解决方案
推荐阅读
- saml - 具有多个 OuputClaims 的 Azure AD B2C 自定义策略 SAML 导致 AADB2C:发生异常
- asp.net-mvc-4 - 在 azure devops 上构建 asp.net mvc 4.5 网站
- ios - 滚动到特定索引 UICollectionView
- c# - Umbraco 7 LINQ 在日期范围内过滤模型儿童
- python - 楼层划分和划分的运算符优先级
- .net - macOS 上的 Quantum 开发工具包中的 Q# 编译器错误
- perl - Perl:非阻塞管道 - 只收到一条消息
- html - 为什么我的 AngularJS 变量作为文字代码传递?
- jquery - 在 jQuery 中使用 this 仅针对选择器的一个实例
- psql - 如何使用 psql 上传大文本文件?