简体   繁体   中英

JAVAFX Text Area is not showing formatted output of the string

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. 这是文字区域的图像 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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM