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.

After almost a work day’s worth of searching, I was able to find a solution to my dilemna. While JTextArea has a getLineCount() method to return the number of lines, I wanted a way to also detect wrapped lines since I wanted to set my component a fixed height if the maximum height limit is reached.

This method by user Jörg in the Java forum did the trick.

It may be common instinct for you to place a horizontal line in a TableLayout within the TableRow tags. However, when I did try that, the horizontal line never stretched to fill the whole width.

The trick is not to place the View tag inside the TableRow tag but outside of it. See example below.

Related Posts Plugin for WordPress, Blogger...