View Single Post
  #7 (permalink)  
Old 09-29-2008, 12:08 PM
GhosT's Avatar
GhosT GhosT is offline
Member
 
Join Date: Sep 2008
Location: Dhaka, Bangladesh
Posts: 37
Rep Power: 0
GhosT is on a distinguished road
Default
another problem...this is the function i made to read IPs from a file and show it in a JTable but its not working, even its not returning any errors..
Code:
private void initTable() {
        String[] col = {"IP Addresses"};
        int row = 20;
        String[][] rows = new String [row][1];
        int i = 0;
        
        /*for (i = 0; i < row; i++) {
            rows[i][0] = "172.16.24.75";
        }*/
        
    try{
    // Open the file that is the first 
    // command line parameter
    FileInputStream fstream = new FileInputStream("iplist.txt");
    // Get the object of DataInputStream
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    String strLine;
    //Read File Line By Line
    while (in.available()!= 0)   {
      // Print the content on the console
      rows[i][1]= br.readLine();
      i++;
    }
    //Close the input stream
    in.close();
    }catch (Exception e){//Catch exception if any
      System.err.println("Error: " + e.getMessage());
    }


        MyTableModel tm = new MyTableModel();
        tm.setColumnNames(col);
        tm.setData(rows);
        table.setModel(tm);

}
when i run this it returns:


init:
deps-jar:
compile-single:
run-single:
Error: 1
BUILD SUCCESSFUL (total time: 4 seconds)



can any one help?
Reply With Quote