I am getting an array of class object (named: store). I have to retrive some values from the store array and want to fill my JTable (Object[][] data) with those values. I have passed this array into a class in which i am planning to draw my user interface which includes the table too. So, my code looks like
public class Dialog { // Here is where i plan to draw my UI (including the table)
....
public Dialog(Store store) { // Store = an array of class object.
.. }
private class TableModel extends AbstractTableModel {
private String[] columnNames = {"Selected ",
"Customer Id ",
"Customer Name "
};
private Object[][] data = {
// ????
};
}
}
Now, my question is if i want to make sure my design is a good design and follows prinicple of OOP then where exactly shall i extract the values from store and how exactly should i pass it into data[][].