File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Problem in loading Flight list on combo box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Problem in loading Flight list on combo box" Watch "Problem in loading Flight list on combo box" New topic
Author

Problem in loading Flight list on combo box

Anurag Mishra
Ranch Hand

Joined: Sep 27, 2001
Posts: 133
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
Mathew Sam
Ranch Hand

Joined: Dec 19, 2001
Posts: 124
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

Joined: Sep 27, 2001
Posts: 133
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

Joined: Dec 19, 2001
Posts: 124
call the getRecord method in the Data class in a for loop.
Anurag Mishra
Ranch Hand

Joined: Sep 27, 2001
Posts: 133
Thanks Sam
This is exactly that I want.
Anurag Mishra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in loading Flight list on combo box