Set one single String but of more strings in a JList component
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, May 31, 2003 08:23 AM

What can I to do for setting one string in a JList component ? // The string is as a List of strings:    "Programs/,Winnt/,Documents and Settings/,......." The strings that I read ,have got from an Socket input:   A peace of client program:   try{ inxx =new BufferedReader(new InputStreamReader(sxx.getInputStream())); outxx=new PrintWriter(sxx.getOutputStream(), true); String richiestax = null; String prefix = "dir "; String fix = jList1.getSelectedValue().toString(); String richiesta = prefix+fix; outxx.println(richies   More>>

What can I to do for setting one string in a JList component ? // The
string is as a List of strings:    "Programs/,Winnt/,Documents
and Settings/,......."




The strings that I read ,have got from an Socket input:



 



A peace of client program:

 



try{



inxx =new BufferedReader(new InputStreamReader(sxx.getInputStream()));

outxx=new PrintWriter(sxx.getOutputStream(), true);



String richiestax = null;

String prefix = "dir ";

String fix = jList1.getSelectedValue().toString();

String richiesta = prefix+fix;

outxx.println(richiesta);







while (true) {



richiestax = inxx.readLine();     // this read a list of
files of a specified remote directory ...


 


... the remote server Write :    File f = new File(str2);

                                               
String[] files = f.list();

                                          
int i;

 

                                              
for( i=0; i

                                            
txtout.println(files[i]);



                                           
if (richiestax.equals("end")) break;                                                                                                                                 


//......... I need to set the input " richiestax" in my JList component to
see the list of remote directory


 


Can you help me  ?


Thanks

   <<Less

Re: Set one single String but of more strings in a JList component

Posted By:   AlessandroA_Garbagnati  
Posted On:   Saturday, May 31, 2003 10:16 AM

Ciao Pier Luigi,

Maybe I didn't understand the problem in the right way, but can't you just split your string in an array (by using StringTokenizer or any other own solution), and create the JList object from that?
About | Sitemap | Contact