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

  • Home
  • SEARCH
  • 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 8073213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:15:58+00:00 2026-06-05T14:15:58+00:00

I am developing a GUI program to use in a client/server system that will

  • 0

I am developing a GUI program to use in a client/server system that will save data in a Vector. I have an ObjectOutputStream and ObjectInputStream that is created when I make the connection, however I am not sure how to pass it into the new class when i try to open one up. In my Startup class I have a Serializable object (Message m) that is created and passed into different classes to have different fields modified, as well as the connection gets established between the client and server

In my Startup class I have this code…

m.yourName = tmyName.getText();
m.department = tdepartment.getText();

if (m.yourName != null && m.department != null) {
    client = new Socket(server, port);
    oout = new ObjectOutputStream(client.getOutputStream());
    oin = new ObjectInputStream(client.getInputStream());
    toutput.setText("Connected");
    oout.writeObject(m);
    new WhatToDo (m, oout, oin);
}

In the WhatToDo class i have this code…

Message m;
ObjectOutputStream oout;
ObjectInputStream oin;

public WhatToDo(Message a, ObjectOutputStream oout2, ObjectInputStream oin2){
    m = new Message();
    m = a;

    // this is what i'm unsure about and need help with
    oout = oout2; //but need to construct oout first
    oin = oin2; //but need to construct oin first
}

If i do the new ObjectOutputStream and ObjectInputStream like I did in Startup, i will create a new connection to the server. I wish to use the existing Streams created in Startup in WhatToDo. Thank you for your help in advance!

I’m using an ActionListener with button presses, so the streams will need to be saved in the constructor for later use in the ActionListener.

  • 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-05T14:16:00+00:00Added an answer on June 5, 2026 at 2:16 pm

    I wish to use the existing Streams

    That is exactly what your code does now. Your comments about ‘but need to construct’ are incorrect.

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

Sidebar

Related Questions

I'm developing a C++ application that needs a GUI. I would like to use
I'm developing a program that receives some data and after processing I want to
I am looking into developing a GUI that will switch the controls based on
I have been developing a program that needs to be run daily bases. I
I'm developing Swing application, and everything works fine usually. But I have an GUI
I am developing a GUI that has a canvas and a bunch of controls
I have been studying swing for developing gui applications since a few days. The
I am developing a GUI application in Qt, and I have some difficulties embedding
I am developing a GUI to launch an external long-term running background program. This
I'm developing a WinForms application in C#. I have limited experience in GUI programming,

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.