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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:51:55+00:00 2026-06-11T09:51:55+00:00

My chat room program. I have 2 packages, 1 for Client & other for

  • 0

My chat room program. I have 2 packages, 1 for Client & other for Server. Run Server program, fill the PortField and click button Start Server, window program is stuck, i cant do anything on it, but Server still work, Clients still connect and chat.

private void btnOpenActionPerformed(java.awt.event.ActionEvent evt) {                                        

    int port = Integer.parseInt(txtPort.getText());
    go(port);
}                                       
private void go(int port){
    try {
        listUser = new Hashtable<String, ClientConnect>();
        server = new ServerSocket(port);
        txaStatus.append("Server is started\n");
        txaStatus.append("IP Server : "+InetAddress.getLocalHost().getHostAddress()+"\n");
        txaStatus.append("Port : " + port + "\n");
        while(true){
            client = server.accept();
            new ClientConnect(this,client);//class ClientConnect for DataOutPut & DataInput Client <=> Server
        }
    } catch (IOException e) {
        txaStatus.append("Server cannot start\n");
                    JOptionPane.showMessageDialog(this,"Port busy","warning",JOptionPane.WARNING_MESSAGE);
                    System.exit(0);
    }
}
  • 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-11T09:51:57+00:00Added an answer on June 11, 2026 at 9:51 am

    You can’t run your server in the GUI Thread, this will prevent the program from accepting any other input. You need to move the go() method into a separate thread.

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

Sidebar

Related Questions

I am doing a client-server voice chat program(unmanaged C++,win32) in which clients connects to
I am making a chat room using simple socket-socket connections. I have a server
I am working on a java program that is essentially a chat room. This
I want to add a chat room for my program - but I want
Here's my situation: I'm writing a chat client to connect to a chat server.
all. I have built a simple jQuery/PHP chat program that works rather well. However,
i want program chatroom and private chat between user . in click on each
I decide to make a chat room. (Server side is PHP or Java). First
I have a social network that is wanting to implement a chat room for
We have implemented a simple chat room feature in Rails using Simple Ajax updates.

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.