STockTable.retrieveData is called by the action listener of the JMenuItem mData. This method delegates the proper retrival of the database, and addition to the model to StockTableData.retrieveData
Say StockData is the class whose instances represent rows contained in the vector that holds the data. The action listener of the copy button will need to find out the rows of the first table whose checkbox is marked. Those rows are the ones that need to be added to the second table. Make new StockData objects representing the content of the previous mentioned rows and add them to the model of the second table in the way shown above.
The Java Tutorial has a section called
How to use Tables I am quotting for the section Detecting Data Changes.
An example of updating a table's data without directly editing it is in the BINGO application. The BINGO application, which is presented in BINGO!, has a table that displays some information about each user who is signed up to play the game. When a new user signs up to play BINGO, the table needs to add a new row for that user. More precisely, the table model needs to get the data for the new user, and then the table model needs to tell the table to display the new data.
To notify the table model about a new user, the BINGO application invokes the table model's updatePlayer method. You can see the code for that method in PlayerInfoModel, which contains the implementation of the table model. The updatePlayer method records the new user's data and fires a table-model event. Because every table listens for table-model events from its model, the user-information table automatically detects the change and displays the new data.
To fire the table-model event, the model invokes the fireTableRowsInserted method, which is defined by the AbstractTableModel class. Other fireXxxx methods that AbstractTableModel defines are fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, and fireTableStructureChanged.
How to use Tables will help you a lot to understand JTables.