• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in loading Flight list on combo box

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to load flight number list on combobox, please tell me the procedure how to load the list in combobox.
My efforts are I had created a getRecords() method in my data class which returns an string array of flight records as follows:
public String[] getRecords()throws IOException{
String [] values=readRecord();
return values;
}
and in my client GUI i am accessing this method with the help of remote interface
eg:
private void loadList(){
try{
recCount=intf.getRecordCount();
for(int i=1; i<=recCount; i++){
String val[]=intf.getRecords();
vec.add(val[0]);
}
}catch(Exception ex){
ex.printStackTrace();
}
}
The client list is loaded sucessfully in one client but when another client application invokes it does'nt load list on second client. Plz tell me the solution how i have to proceed to get the accurate results
Anurag Mishra
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anurag,
There is some logical error in your code.The readRecord() method in your Data class read one reord from the current location of the file pointer.By the time it read records for the first client the file poinetr reaches end of file.So for next clients it won't return any records
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mathew Sam
So what will be the correct way to load list to my combobox. Plz send me some discriptive solution regarding this problem, i will be really thankful to you.
Anurag Mishra
 
Mathew Sam
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
call the getRecord method in the Data class in a for loop.
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sam
This is exactly that I want.
Anurag Mishra
 
please buy my thing and then I'll have more money:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic