JAVAFX Text Area is not showing formatted output of the string












2















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.










share|improve this question

























  • Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

    – Joop Eggen
    Jun 18 '13 at 15:12













  • Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

    – Rohan
    Jun 18 '13 at 15:27
















2















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.










share|improve this question

























  • Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

    – Joop Eggen
    Jun 18 '13 at 15:12













  • Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

    – Rohan
    Jun 18 '13 at 15:27














2












2








2


2






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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 18 '13 at 15:06







Rohan

















asked Jun 18 '13 at 14:59









RohanRohan

2013720




2013720













  • Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

    – Joop Eggen
    Jun 18 '13 at 15:12













  • Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

    – Rohan
    Jun 18 '13 at 15:27



















  • Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

    – Joop Eggen
    Jun 18 '13 at 15:12













  • Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

    – Rohan
    Jun 18 '13 at 15:27

















Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

– Joop Eggen
Jun 18 '13 at 15:12







Add a CSS style with a non-proportional monospaced font, like Courier, Lucida-Console. You used a font where m is larger than an i.

– Joop Eggen
Jun 18 '13 at 15:12















Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

– Rohan
Jun 18 '13 at 15:27





Not getting u clearly...do mean i need to add css style sheet for text area ? if so..can you please tell me how to add it in javafx? FXML

– Rohan
Jun 18 '13 at 15:27












1 Answer
1






active

oldest

votes


















7














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.






share|improve this answer


























  • I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

    – Rohan
    Jun 18 '13 at 15:47













  • Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

    – Joop Eggen
    Jun 18 '13 at 15:54













  • @Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

    – Uluk Biy
    Jun 18 '13 at 16:03











  • @Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

    – Rohan
    Jun 19 '13 at 6:58














Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17172249%2fjavafx-text-area-is-not-showing-formatted-output-of-the-string%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









7














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.






share|improve this answer


























  • I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

    – Rohan
    Jun 18 '13 at 15:47













  • Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

    – Joop Eggen
    Jun 18 '13 at 15:54













  • @Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

    – Uluk Biy
    Jun 18 '13 at 16:03











  • @Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

    – Rohan
    Jun 19 '13 at 6:58


















7














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.






share|improve this answer


























  • I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

    – Rohan
    Jun 18 '13 at 15:47













  • Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

    – Joop Eggen
    Jun 18 '13 at 15:54













  • @Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

    – Uluk Biy
    Jun 18 '13 at 16:03











  • @Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

    – Rohan
    Jun 19 '13 at 6:58
















7












7








7







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.






share|improve this answer















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.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 1 '18 at 11:57









Aubin

11.4k64566




11.4k64566










answered Jun 18 '13 at 15:27









Uluk BiyUluk Biy

39.9k6112136




39.9k6112136













  • I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

    – Rohan
    Jun 18 '13 at 15:47













  • Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

    – Joop Eggen
    Jun 18 '13 at 15:54













  • @Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

    – Uluk Biy
    Jun 18 '13 at 16:03











  • @Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

    – Rohan
    Jun 19 '13 at 6:58





















  • I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

    – Rohan
    Jun 18 '13 at 15:47













  • Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

    – Joop Eggen
    Jun 18 '13 at 15:54













  • @Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

    – Uluk Biy
    Jun 18 '13 at 16:03











  • @Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

    – Rohan
    Jun 19 '13 at 6:58



















I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

– Rohan
Jun 18 '13 at 15:47







I tried with DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: monospace"); and DeploymentTaskController.actLogTArea.setStyle("-fx-font-family: Courier"); still facing same issue

– Rohan
Jun 18 '13 at 15:47















Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

– Joop Eggen
Jun 18 '13 at 15:54







Maybe try with an id: in fxml: fx:id="actLogTextArea" and as you seem to have a global .css: #actLogTextArea { ... }. Or with .text. (No experience myself)

– Joop Eggen
Jun 18 '13 at 15:54















@Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

– Uluk Biy
Jun 18 '13 at 16:03





@Rohan Are you sure that the setStyle() line has been executed? I tried myself and worked like as expected.

– Uluk Biy
Jun 18 '13 at 16:03













@Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

– Rohan
Jun 19 '13 at 6:58







@Uluk its working properly now...i just inserted that code in initialize method and its working now...thanks :-)

– Rohan
Jun 19 '13 at 6:58






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17172249%2fjavafx-text-area-is-not-showing-formatted-output-of-the-string%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)