i have a hashMap which i would like its data to be viewed in a JTable how ever i am having trouble getting the hashMap amount of columns and rows and the data to be displaye
Why not create an object that implements an interface in the fashion that JTable desires (an Object
array), and provides a bridge to your existing map of Students ? So you can keep your existing data structure that is obviously working for you, and you're simply providing an adaptor for the benefit of the view (the JTable).
From the link:
An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms.
I would try not to change a working data structure to fit with a particular GUI component (what happens if at a later stage you want to display via HTML or similar) but adapt to each view as a requirement comes up.