SWT Table.setLinesVisible(false) does not seem to work on Windows 7

后端 未结 1 1055
耶瑟儿~
耶瑟儿~ 2021-01-15 01:32

Our company is trying to move everyone from Window XP to Windows 7, so I\'m testing some of the home-grown SWT applications to make sure that they still work on Windows 7. M

相关标签:
1条回答
  • 2021-01-15 02:28

    Try adding the following listener to your table:

          //Assuming your table is named 'table' and 'backgroundColor' is the
          //color you're using to paint it's background.
          table.addListener(SWT.EraseItem, new Listener() {
            @Override
            public void handleEvent(Event event) {
              event.gc.setBackground(backgroundColor);
              event.gc.fillRectangle(event.getBounds());
            }
          });
    


    This should solve your problems with vertical lines. Here's how it looks on my example table:

    Without the listener (notice the vertical lines, they are not black in my case, they're gray..but they're still visible):

    enter image description here

    And now with the listener added:

    enter image description here

    0 讨论(0)
提交回复
热议问题