I apologise in advance for the length of this post but I have provided a rather in depth of the design and implementation of my program.BackgroundI am currently doing a group (there are 2 of us) programming project for a third year computer science course at university.The goal of this program is to essentially use a spreadsheet program to represent XML file data where each XML file is a historical record. Design:Each record(row) in the spreadsheet corresponds to a single XML file and the columns of the record correspond to the elements in the XML file. We deal with repeated elements (i.e. elements with the same tag) by setting the cell component to a button that, when clicked, opens up another spreadsheet which contains a list of all elements with repeated names (for the corresponding file). Child elements are dealt with in a similar manner whereby if an element ha child elements then the corresponding cell in the XML file contains a button which, when clicked, opens up a spreadsheet containing all the child elements of that element.Implementation:The implementation of our system is written in Java. Our main class (name SpreadSheetGUI) extends JFrame to which we add a JTable (using the default table model). We have three different cell renderers: one for when a cell justhas text, one for when a cell has a button and one for when we have text and a button in a cell. When a button is clicked to open up a new spreadsheet (for either child elements or repeated element names) we make a recursive call to our spreadsheet constructor which will then create our sub-spreadsheet. The renderers are added in the following order: if the cell corresponds to an element with a tag that is used more than once a button is added to the cell, otherwise if the cell corresponds to an element with child nodes we add both text and a button to the cell and if the cell just has text we add the text to that cell. The Problem:As I mentioned before we have created a set of renderers to handle the adding of buttons to cells but it seems that when a "child" spreadsheet is created the renderers are trying to render cells that are out of bounds in accordance with the child spreadsheets number of rows and columns and throw an array index out of bounds exception. I'm guessing the problem extends from the fact that we are making a recursive call to our spreadsheet constructor. A friend also suggested that this problem might be caused by the default table model, should I consider creating a custom table model?I haven't included my code because it is rather lengthy (Around 2000 lines in total) but I am willing to give it on request. I have been wracking my brains with this one and I have been completely unsuccessful in finding any threads related to this problem.