java - Remove inner vertical borders in a JTable -


i want remove inner borders in jtable. i've researched question , found remove vertical borders jtable like:

---------------------            +-------+-------+-------+ (0,0)   (0,1)   (0,2)            | (0,0) | (0,1) | (0,2) | ---------------------            +-------+-------+-------+ (1,0)   (1,1)   (1,2) instead of | (1,0) | (1,1) | (1,2) | ---------------------            +-------+-------+-------+ (2,0)   (2,1)   (2,2)            | (2,0) | (2,1) | (2,2) | ---------------------            +-------+-------+-------+ 

however want this:

+-----------------------+ | (0,0)   (0,1)   (0,2) | +-----------------------+ | (1,0)   (1,1)   (1,2) | +-----------------------+ | (2,0)   (2,1)   (2,2) | +-----------------------+ 

any appreciated!

i couldn't think of neat way solve not involve overriding internal paint() call, messy. here less elegant solution: disable vertical lines , add line border of apropiate color.

table.setshowverticallines(false); color linecolor = new color(122, 138, 153); //(122, 138, 153) rgb color of lines, @ least in computer/os/l&f... table.setborder(borderfactory.createlineborder(linecolor)); 

result:

enter image description here


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -