Skip to main content

Vertical grid lines seem to be broken in JXTreeTable

4 replies [Last post]
scroyston
Offline
Joined: 2005-04-04

The Tree rendered column never has the vertical grid line. The other 'table' rendered ones show up until you add a Highlighter to the equation, then they disappear. Horizontal grid lines seem fine. Any ideas?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
airgrib
Offline
Joined: 2010-10-06

This worked for me:

treeTable.setColumnMargin(1);

rameshgupta
Offline
Joined: 2004-06-04

> The Tree rendered column never has the vertical grid
> line.

The way grid lines are rendered in JTable poses a problem when the row/column margin is zero, but showHorizontalLines/showVerticalLines (respectively) is true. The problem is that BasicTableUI.paintGrid() draws grid lines without regard to whether the row/column margins are greater than zero or not. The problem is particularly vexing because the paintGrid() method is private, meaning that JXTable and JXTreeTable cannot override that by subclassing BasicTableUI (not that one would want to do that anyway)!

JXTreeTable constructor calls setShowGrid(false) in an attempt to force developers to reckon with this. We could either take this out of the constructor, or push it into JXTable constructor depending on your feedback.

So, the solution is to explicitly set the row and column margins to greater than zero; then grid lines will be shown. Do you want this, along with setShowGrid(true), to be the default?

> The other 'table' rendered ones show up until
> you add a Highlighter to the equation, then they
> disappear. Horizontal grid lines seem fine. Any
> ideas?
>
> Thanks

As long as the margins are non-zero, grid lines should be drawn properly regardless of whether you have highlighters or not. Please let me know if this is not what you see.

Ramesh

siva
Offline
Joined: 2003-07-15

> Do you want this, along with setShowGrid(true), to be the default?

Yes. I think so.

siva
Offline
Joined: 2003-07-15

I have the same issue. I don't see the vertical lines even though I have showGrid(true) in my code.