• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem in loading Flight list on combo box

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks Sam
This is exactly that I want.
Anurag Mishra
 
Wanna see my flashlight? How about this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic