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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:51:25+00:00 2026-06-07T03:51:25+00:00

I am trying to create a chat client for a program of mine and

  • 0

I am trying to create a chat client for a program of mine and I would like to open a new window for each chat (A & B will not be in the same window as A & C) I have psudocode for what I am trying to do but unsure on how to write it.

Chat client:

inputstream.read()
Read who message from
If (chat window arleady open with person from)
{
    Add Message to output section of the window
{
else if (chat window not open)
{
    Open new chat window with person from
    Display message in new chat window
}

To do this, the thing I have thought about is storing the IPs in an array and then whenever the client gets a message it would look through the array to see if the IP was stored. If it is stored, the window should already be open, otherwise the window needs to be opened. I can program this by using the defaultonclose command from JFrame to just call a removal of the IP when the window is closed, but here are the problems I am running into.

  1. Once I search the array for the IP addresses, If the window is already open (say I have A B and C talking to D) how do I insure if C sends a message that it gets placed in the C window?

1.1 I have thought about spawning a new thread, naming the thread, and then when a message comes in pass it into the the thread that matches the name, but I am not sure about how to do that. I have read the names of threads before but never passed something into a specific thread.

Is there anyway to do this easier without downloading extra libs?

  • 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-07T03:51:26+00:00Added an answer on June 7, 2026 at 3:51 am
    • don’t use JFrame for another window, because you can’t to set parent v.s.owner, use JDialog instead

    • then JFrame.getOwnedWindows() returns all instances of JDialog(s) where is used JDialog(myFrame owner)

    • in all cases Window[] allWindows = Window.getWindows(); returns all instances from current JVM, returns all instances of (J)Frames, (J)Dialogs, (J)Windows or JOptionsPanes

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

Sidebar

Related Questions

I am trying to create a simple chat client using the red5 media server,
I am trying to create a very simple chat window that simply has the
I'm trying to create a client-server program that send and receive a string (its
I am trying to create a fullscreen chat program using Flash AS3, and so
I am new to UDP/networking programming, and I am trying to create a chat
I'm trying to create a simple chat application for iOS. It currently looks like
I am trying to create a mobile version of a facebook chat client. I
I'm trying to create a very basic chat system, part of which will be
I was trying to create an XMPP and a Jabber chat-program. I was unable
I am trying to create a listview with balloons. Its like a threaded chat

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.