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();

                                                   }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: