• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to make a specify client

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have make a Constructor to make the user to have a specify program , but I do not know how to make the specify class that contains the user's configuration info to be the *.java
file (with the java language). who can help me ,Thank you !
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please elaborate? I am thinking there is a translation problem here, because I can't understand what you are asking.


And BTW, welcome to the JavaRanch.

Henry
 
filson sun
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:Can you please elaborate? I am thinking there is a translation problem here, because I can't understand what you are asking.


And BTW, welcome to the JavaRanch.

Henry



Thank you for paying attention to my question. My problem is that I am making a C/S program ,then I want to make the Client program with the configuration that let the user to fill it.
the Class is
"Class ClientFrame{
public ClientFrame(String hostIp, String hostPort){
........
}
}"
where,I want to save the specify instance of the ClientFrame ,then I can make it to the client user ,and he or she can use the *.java or *.jar to connect the host user computer.
But, I do not know how to save the specify instance of the ClientFrame ,and save it like the *.java or *.jar.
 
Henry Wong
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

filson sun wrote:
where,I want to save the specify instance of the ClientFrame ,then I can make it to the client user ,and he or she can use the *.java or *.jar to connect the host user computer.
But, I do not know how to save the specify instance of the ClientFrame ,and save it like the *.java or *.jar.



To directly answer your question. You can pre-instantiate the objects that you want, and serialize them to a file. Then your program can simply derserialized the instances from those files.

However, I am guessing that this is *not* optimal. In your description, you sound like you want to set configurations. It might be a better idea to simply create configuration files, in any format that you want; and during application start up, load the configuration files, to instantiate the objects that you need.

Henry
 
filson sun
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

filson sun wrote:
where,I want to save the specify instance of the ClientFrame ,then I can make it to the client user ,and he or she can use the *.java or *.jar to connect the host user computer.
But, I do not know how to save the specify instance of the ClientFrame ,and save it like the *.java or *.jar.



To directly answer your question. You can pre-instantiate the objects that you want, and serialize them to a file. Then your program can simply derserialized the instances from those files.

However, I am guessing that this is *not* optimal. In your description, you sound like you want to set configurations. It might be a better idea to simply create configuration files, in any format that you want; and during application start up, load the configuration files, to instantiate the objects that you need.

Henry




Thank you! I will use your second idea
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic