Reputation: 141
I have displayed a JTable in my JPanel.The JTable is inside a scrollpane. The only problem is the gridlines are not showing up.I tried to use this line of code but it didn't work.
table.setShowGrid(true);
Below is a picture: Note there are no gridlines
Thank you in advance.
Upvotes: 8
Views: 13247
Reputation: 121
table.setShowHorizontalLines(true);
table.setShowVerticalLines(true);
Upvotes: 12
Reputation: 6286
Does having an etched border make a difference?
table.setBorder(new EtchedBorder(EtchedBorder.RAISED));
EDIT:
The default colour of grid-lines seems to be white:
table.setGridColor(Color.BLUE)
Upvotes: 12