Java Basic Problems

Java: Collect JTable value to Vector

Sometimes in Java programming we may need to collect the value in the JTable to a Vector

Here is a portion of the java  code  which   is used to  collect JTable value to Vector.                                                  

                                                    

Code Example:

                                                     try

                                                  {

                                                            Vector data=new Vector(); // import java.util.Vector;                           

                                                            for(int i=0;i<jtable_config.getRowCount();i++)

                                                            {                     

                                                                        data.add(jtable_config.getValueAt(i,0));

                                                                        data.add(jtable_config.getValueAt(i,1));

                                                                        System.out.println(“id”+data);

                                                                        System.out.println(“name”+temp.VALUE);

                                                            }

                                                           }

                                               catch (RemoteException e1)

                                                   {      

                                                   e1.printStackTrace();

                                                   }