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 7880733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:12:53+00:00 2026-06-03T04:12:53+00:00

I need to have a parallel function running all the time in my program.

  • 0

I need to have a parallel function running all the time in my program.
I don’t know if I am thinking correct, but what I want to do is to have a piece of code updating my TextArea all the time, getting information from a server.

I am using RMI, just you to know.

Can I create a thread function, within MainClass, and let it run all the time?

Or how can I create a thread to update my TextArea in another class? How do I share my TextArea?

  • 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-03T04:12:54+00:00Added an answer on June 3, 2026 at 4:12 am

    Not sure if I am understanding, I will assume TextArea means a JTextArea and MainClass is the application’s entry point.

    What prevents you from doing it like this?

    public class Updater implements Runnable {
        private JTextArea textArea;
    
        public Updater(JTextArea textArea){
            this.textArea = textArea;
        }
    
        @Override
        public void run(){
            SwingUtilities.invokeLater(new Runnable(){
                public void run(){
                                //do what you've got to do....
                    textArea.setText("New Text");
                }
            });
        }
    
    }
    

    And in your “MainClass” something like this:

    public static void main(String[] args) {
    
        Thread myThread = new Thread(new Updater(myTextArea));
        myThread.start();
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have need for a function pointer that takes two arguments and returns a
I need to have a newline every time I write to a file in
I need to have a value returned by and event handler into the function
I have done some web based projects, but I don't think too much about
I don't know much about Javascript, and this function I wrote doesn't seem to
I have a web application running on Tomcat. There are several calculations that need
I'm using Incanter and Parallel Colt for a project, and need to have a
I have a C program that aims to be run in parallel on several
I have a main program written in C, i need it to launch another
This is my first time I need to create a cutscene system. I have

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.