开发者

JTable without horizontal and vertical lines

开发者 https://www.devze.com 2023-01-08 13:29 出处:网络
How to create a JTable wi开发者_开发知识库thout vertical and horizontal lines in it...Try playing around with setShowGrid(), setShowVerticalLines() and setShowHorizontalLines()

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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消