Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:27:22+00:00 2026-06-15T19:27:22+00:00

Update: Still having the same issue, revised source of main app code: http://pastebin.com/fLCwuMVq There

  • 0

Update:

Still having the same issue, revised source of main app code:
http://pastebin.com/fLCwuMVq

There must be something in CoreTest that blocks the UI, but its doing all sorts of stuff (async xmlrpc requests, async http requests, file io etc), i tried putting it all into runLater but it doesnt help.

Update 2:

I verified the code runs and produces output correctly but the UI component cant manage to display it for ages

Update 3:

OK I fixed it. I don’t know why, but no guide about JavaFX said this, and its very important:

Always put your program logic in a separate thread from the Java FX thread


I had this working with Swing’s JTextArea but for some reason it doesn’t work with JavaFX.

I tried debugging and it and doing .getText() after each write returns what seems to be characters written to it properly, but the actual TextArea in GUI shows no text.

Did I forgot to somehow refresh it or something?

TextArea ta = TextAreaBuilder.create()
    .prefWidth(800)
    .prefHeight(600)
    .wrapText(true)
    .build();

Console console = new Console(ta);
PrintStream ps = new PrintStream(console, true);
System.setOut(ps);
System.setErr(ps);

Scene app = new Scene(ta);
primaryStage.setScene(app);
primaryStage.show();

And the Console class:

import java.io.IOException;
import java.io.OutputStream;

import javafx.scene.control.TextArea;

public class Console extends OutputStream
{
    private TextArea    output;

    public Console(TextArea ta)
    {
        this.output = ta;
    }

    @Override
    public void write(int i) throws IOException
    {
        output.appendText(String.valueOf((char) i));
    }

}

Note: this is based on a solution from this answer, I removed bits I didn’t care about but unmodified (apart from changing from Swing to JavaFX), it had the same result: data written to the UI element, no data showing on the screen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:27:23+00:00Added an answer on June 15, 2026 at 7:27 pm

    Have you tried running it on the UI Thread?

    public void write(final int i) throws IOException {
        Platform.runLater(new Runnable() {
            public void run() {
                output.appendText(String.valueOf((char) i));
            }
        });
    }
    

    EDIT

    I think your problem is that your run some long tasks in the GUI thread, which is going to freeze everything until it completes. I don’t know what

    CoreTest t = new CoreTest(installPath);
    t.perform();
    

    does, but if it takes a few seconds, your GUI won’t update during those few seconds. You need to run those tasks in a separate thread.

    For the record, this works fine (I have removed the file and CoreTest bits):

    public class Main extends Application {
    
        @Override
        public void start(Stage primaryStage) throws IOException {
    
            TextArea ta = TextAreaBuilder.create().prefWidth(800).prefHeight(600).wrapText(true).build();
            Console console = new Console(ta);
            PrintStream ps = new PrintStream(console, true);
            System.setOut(ps);
            System.setErr(ps);
            Scene app = new Scene(ta);
    
            primaryStage.setScene(app);
            primaryStage.show();
    
            for (char c : "some text".toCharArray()) {
                console.write(c);
            }
            ps.close();
        }
    
        public static void main(String[] args) {
            launch(args);
        }
    
        public static class Console extends OutputStream {
    
            private TextArea output;
    
            public Console(TextArea ta) {
                this.output = ta;
            }
    
            @Override
            public void write(int i) throws IOException {
                output.appendText(String.valueOf((char) i));
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a sample page having an issue: http://estorkdelivery.com/template/view/69 Our website serves up a
I'm still working on my phone book app and I want to update a
Edite: refined the code according to advice in comments but still no luck Update:
I'm having a little issue with some php logic in my main index page,
I'm working on a MasterDetail app, and having an issue updating my itemCells. Using
I'm having an issue that's incredibly hard to debug. If my app is using
UPDATE I answered my question below, but I am still asking for a prettier
On Ubuntu 11.04, I've installed 'TortoiseHg' and 'TortoiseHg-Nautilus' through Software Update Center, but still
Okay I have updated my code a little, but I am still not exactly
Update: Is there a way to achieve what I'm trying to do in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.