0
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
            Date date = sdf.parse(d);
            Calendar cal = GregorianCalendar.getInstance();
            cal.setTime(date);

            for (i=0;x>i;i++){

            cal.add(GregorianCalendar.DATE, 7);
            String t = sdf.format(cal.getTime());
            DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
            model.addRow(new Object[]{t,c});
            }
4
Contributors
3
Replies
24
Views
2 Months
Discussion Span
Last Post by Tarek_2
1

it boils down to this:

step 1a: learn to read data from a JTable (which is not an array, just so you know)
step 1b: write the code that does so

step 2a: learn to write data into a DB
step 2b: write the code that does so

step 3: combine the code from 1b and 2b

0

In addition to what stultuske has said, you can use t and c directly because they are the content of the JTable row.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.