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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:17:51+00:00 2026-05-13T20:17:51+00:00

EDIT : To make things clearer- I have an application that connects to a

  • 0

EDIT: To make things clearer-

I have an application that connects to a remote server and updates a GUI. The application uses the MVC pattern.

1) The remote server may send a message that updates the data model of my application.

2) The GUI controller classes implement the PropertyChangeListener interface, and listen for updates on the model, and update the GUI view classes

3) The application is able to send messages back to the remote server following a user action on the GUI. This uses the same object that receives data from the remote server.

I currently initialise the ‘remote server communication’ object and the GUI classes in my main method. Since the communication object can update the model independently, should I initialise this object using SwingUtilities.invokeLater()?

  • 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-05-13T20:17:52+00:00Added an answer on May 13, 2026 at 8:17 pm

    I’m not completely sure I get you, but I just have one thing to throw in anyway–

    Be sure that any time you touch the GUI, it’s on the AWT thread. In theory, this means even creating the GUI (Although in practice, there is rarely a problem creating the GUI in the thread given to your main or some other thread, but sun did detect an issue at one point and suggests against it)

    Anyway, this implies that you use invokeLater any time you wish to update the GUI from a different thread. Period.

    (Note that whenever the GUI calls you via a callback (ActionListener, etc) that will always be the AWT thread so you can do anything you want with the GUI within callbacks.

    With your revised message, I might suggest that if you have a chance of a thread contention and are doing GUI I/O anyway, one way to handle it would be to do all your “contentious” stuff in an invokeLater.

    Although it’s mostly legal to instantiate a GUI in your main thread (everything up to the setVisible(true)–in theory), if there is any chance of a conflict from another thread, invokeLater will take care of it all in a very deterministic way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: After realizing I have to make things public so to speak this is
EDIT: Just to make things clear, this problem was caused by a typo in
I have a crystal report file I need make a tiny edit in. It
I want to make a edit profile form for my website. My idea is
Is there a way to make a click-to-edit control in silverlight? I've got some
I'm trying to edit the output joomla main_menu module so I can make a
Can you make file copying faster through multiple threading? Edit : To clarify, suppose
How to make a multi-thread python program response to Ctrl+C key event? Edit: The
I am looking for a tool which will make able to edit parts of
So. Let's say I were to make a hex editor to edit... oh... let's

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.