In a Java desktop app with SWT-based GUI, we have a table in which some rows must span multiple columns. This was solved with the approach shown in this official SWT Snippet: Snippet239.java
However, much later it was discovered that there’s a major problem with this approach on Ubuntu with the default Ambiance/Radiance theme: There are always vertical lines between the columns, even for cells that span multiple columns. This is shown in the following screenshots:


As you can see, in the first screenshot there’s a vertical line between Column 1 and Column 2. Does anybody have an idea how to get rid of these lines?
We’ve already tried the following:
Table.setLinesVisible(false): Doesn’t work, the vertical lines don’t go away.- Use owner-draw-based label providers to draw over those vertical lines: Doesn’t work, the vertical lines seem to be drawn on top of everything that is drawn by the label providers.
- Attach paint listener to table to draw over the vertical lines: Doesn’t work, because there are lots of glitches whenever the table is scrolled or otherwise updated.
- The Nebula project has a Grid widget where cells can span multiple columns, and it doesn’t have a problem with vertical lines, because the entire table is drawn non-natively. However, we can’t justify the effort to replace our table with a Grid widget just to fix the vertical lines problem on a particular platform with certain themes. Also, the Grid widget seems to be a pre-release alpha version.
Based on the things we’ve already tried, I assume the only way left is to muck around in the platform-specific internals of SWT, but I don’t even know where to start with something like that.
We solved this problem by using a
Tablewith a single owner-draw column that emulates multiple columns.