Some java help needed!

damar thapa <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi,

I have the following code:


else if (key.equals("Country")) {
                String[]  countryList;
        int i=0;
        try{
            BufferedReader in = new BufferedReader(new 
FileReader("countries.txt"));
            String str=null;
   
            while ((str= in.readLine())!=null){
                countryList[i++]=str;
            }
            in.close();
        } catch (IOException e){}

        BSelect country = new BSelect();
                country.setListData(countryList);
                return country;
             }
   
I am trying to read the list of countries from countries.txt file, put 
them in countryList (array of string), and send the list as parameter of 
setListData to the instance of BSelect.

Seems, I cann't store them in array, any pointers?

Thanks.

Damar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.