You want to add all XML elements that are inside of the Cube element, correct? So you need to know when the parser is encountering elements that are inside the Cube element - that's what the variable accomplishes.
Are you completely clear on how a SAX parser goes about parsing an XML document, and how it reports results to your code?
Examine why the exception happens, and then change the code to address the problem.
Seriously, you need to apply yourself harder to this problem. It seems you're lost every time you hit a snag, and just give up trying to work out what the problem is. That is not the way to success in software development.
Breaking problems into pieces also helps: here you mixed XML processing with creating a Swing GUI - topics that have nothing to do with each other. Next time around, get the XML processing right before working on the GUI to display the results. That makes it easier to solve issues with the individual parts.