JAVAFX Text Area is not showing formatted output o

2019-01-26 00:30发布

Here scenario is program reads output properly and it is also printing properly in the log file but when displying same output on JAVAFX text area its format is getting changed(Its in tabular format) and its not displaying properly. This is the image of text area Below is the output getting written in log file:

 ****************PR Deploy Summary Report Start****************
 Folder                   Server                   Type                     Failed                  
 010_StyleSheets          10.5.50.195              SS                       0                       
 010_StyleSheets          10.5.50.195              WS                       0                       
 020_XSL                  10.5.50.195              SS                       0                       
 030_XSLT                 10.5.50.195              SS                       0                       
 040_WebTemplates         10.5.50.195              SS                       0                       

 ****************PR Deploy Summary Report****************

Actually when i am copying this from text area and pasting it somewhere else then its agian showing it properly in tabular format.But its not displaying it properly on text area. There is very simple code written for this as below:

DeploymentTaskController.actLogTArea.appendText(UnixBoxTask.summary.toString());

                DeploymentTaskController.actLogTArea.end();

Here "actLogTArea" is the reference of text area, summary is StringBuilder ...can anybody guess what can be the issue here? any solution if somebody has already faced this? it may be possible that image i have placed in question is not visible.

标签: java javafx-2
1条回答
放荡不羁爱自由
2楼-- · 2019-01-26 01:25

Change the font of textArea to generic monospaced one:

actLogTArea.setStyle("-fx-font-family: monospace");

To change other font properties (and see limitations) refer to JavaFX CSS Reference Guide.

查看更多
登录 后发表回答