我在JPanel中显示了一个JTable.JTable位于一个滚动窗口内.唯一的问题是网格线没有出现.我试图使用这行代码,但它不起作用.
table.setShowGrid(true);
Run Code Online (Sandbox Code Playgroud)
下面是一张图片:注意没有网格线
先感谢您.
蚀刻边框会有所不同吗?
table.setBorder(new EtchedBorder(EtchedBorder.RAISED));
Run Code Online (Sandbox Code Playgroud)
编辑:
网格线的默认颜色似乎是白色:
table.setGridColor(Color.BLUE)
Run Code Online (Sandbox Code Playgroud)
小智 8
table.setShowHorizontalLines(true);
table.setShowVerticalLines(true);
Run Code Online (Sandbox Code Playgroud)