Hiding all column headers of a JTable is pretty easy. You just need to set to null the method setTableHeader(null).
A very common problem is that once you call this method, nothing happens. The column headers still get displayed. While other workarounds involve setting column header labels to blank, you would still need column names to get access to the column object through their column names (I prefer this way compared to accessing it via a column’s index number directly).
The JTable method setTableHeader() when set to null is only good if there is no JScrollPane on it. Chances are there is one attached to your JTable object because it is needed when you have many rows to consider. You need to call a second method from the JScrollPane in order for the column headers to be hidden. Call the setColumnHeaderView() method and set it to null.
That should do the trick.