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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:02:07+00:00 2026-05-28T04:02:07+00:00

I have to create an application having a GUI. my application has to work

  • 0

I have to create an application having a GUI. my application has to work as a server. When it starts, it has to accept all the incoming connection and write the output in a JTextArea. my problem is where I have to create the ServerSocket ss = new ServerSocket(port_number) and the method ss.accept in the way I can accept connections. I tried to create in the main constructor of my gui but being ServerSocket anI/O request the gui stucks.some idea to resolve the solution?

I create in the constructor of my GUI:

SwingUtilities.invokeLater(new Runnable(){public void run(){connection();}});

where connection() is the method where I create the serversocket and accepts call

  • 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-28T04:02:08+00:00Added an answer on May 28, 2026 at 4:02 am

    You should create a separate thread to wait/handle the network connections.

    When a new connection comes in read the data and pass them to the EDT to update the GUI.

    This way the GUI will be responsive.

    You should read about MVC Pattern threads. If you Google there is an abundance of articles to study

    UPDATE:

    Your code here is wrong.

    SwingUtilities.invokeLater(new Runnable(){public void run(){connection();}});

    You are handling the connection from the EDT thread.
    You should use this to update the GUI and not to call the network I/O code.

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

Sidebar

Related Questions

I want to create an application which will have a client and server components.
Good Morning. I have a question about how to create an application without GUI.
I have a GUI C# application that has a single button Start/Stop. Originally this
Suppose you have a client/server application, say a webserver component and a qt gui.
I am having a problem using the Unity Application Block, I have created a
I am new to web development, I have to create a web application in
I have to create a dialog based application, instead of old CFormView type of
I have to create a user in a third party application that stores its
I have to create a DLL which is used by a VB6 application. This
I have to create a UML activity diagrams for a searching application for a

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.