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:
Comments
Post a Comment