JTable without horizontal and vertical lines
How to create a JTable wi开发者_开发知识库thout vertical and horizontal lines in it...
Try playing around with setShowGrid()
, setShowVerticalLines()
and setShowHorizontalLines()
setShowVerticalLines()
Sets whether the table draws vertical lines between cells. If showVerticalLines is true it does; if it is false it doesn't.
Examples:
table.setShowGrid(false);
table.setShowVerticalLines(false);
table.setShowGrid(false);
table.setShowHorizontalLines(false);
jTable4.setShowHorizontalLines(true); // only HorizontalLines
jTable4.setShowVerticalLines(true); // only VerticalLines
jTable4.setShowGrid(true); // show Horizontal and Vertical
jTable4.setGridColor(Color.yellow); // change line color
use this code :)
精彩评论