So there seems to be an issue regarding the JTable grid when viewed in Mac OSX. The grid lines disappear. Well, not literally. They are probably colored white set as the default hence the perception that the grid lines do not get displayed.
To remedy this issue, just call setGridColor() of JTable and it should then display the grid lines according to the color you specify.
Now this, is the best code snippet I found in Java that can auto adjust the JTable row height regardless what kind of renderer component is used.
I had been using some short code snippet that sets a JTextPane or JEditorPane content, then getting the height. However, when my content was full of HTML tags, the height returned really messed my JTable.
This code I found in Stack Overflow by user camickr really is the best solution for auto adjusting all rows heights of a JTable based on content.
JTable has an auto sorting feature through the use of the setAutoCreateRowSorter() method. However, try inserting a new row to its DefaultTableModel and you will find out it is not displayed correctly at the right index row position if the JTable is in sort mode.
There is no automatic way to fix this problem with just a set method. You will have to instantiate a TableRowSorter object and assign that DefaultTableModel as its parameter, assign it to the JTable‘s setRowSorter() method and set the TableRowSorter‘s setSortsOnUpdates() method to true.
That should fix it. So whenever you insert a new row and you already clicked a column header to sort the JTable in ascending or descending order, the newly added row will be sorted accordingly right away.