Menu

Disable Scroll Bars

Developers
Jose
2012-05-11
2013-05-08
  • Jose

    Jose - 2012-05-11

    Hi,

    I'd like to not have scroll bars in my table. What I do is to not have a viewport layer, since is the layer that adds the scrolling funcionallity, and it is true that I don't have scrolling, but the scroll bars appear as disabled. Do you know how to get rid of them?

    Thanks,
    Jose

     
  • gingleby

    gingleby - 2012-05-12

    The scrollbars are on the NatTable intself (Scrollable interface).  If you are not using a ViewportLayer you can call natTable.getVerticalBar().setVisible(false), natTable.getHorizontalBar().setVisible(false); That will hopefully work for you. 

    The ViewportLayer only enables the scrollbars.  They are disabled by default. 

    NatTable can be constructed with an optional style, if you don't include the SWT.VERTICAL/HORIZONTAL scrollbars a null pointer exception is thrown when NatTable tries to disable the scrollbars.  I think that's a bug. 

    Hopefully the above workaround will get you what you need.

    -Graeme

     
  • Jose

    Jose - 2012-05-15

    Hi Graeme,

    Thanks for the answer! I'll give this workaround a try :-)

    Thanks,
    Jose

     
  • Jose

    Jose - 2012-05-16

    Hi again,

    Graeme, your workaround certainly work, at least as far as I've tested it. Thanks!

    Jose

     

Log in to post a comment.