Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable horizontal scroll bars in the swt table?

Tags:

java

swt

To disable vertical scroll bar i used the following syntax

table.getHorizontalBar().setEnabled(false);

But it is not working. It is ruining my application ui. How can i disable it?

like image 797
Ankur Trapasiya Avatar asked Nov 29 '22 15:11

Ankur Trapasiya


2 Answers

Use option SWT.NO_SCROLL and SWT.V_SCROLL while constructing the table as following:

new Table (shell, SWT.NO_SCROLL | SWT.V_SCROLL);
like image 186
eike Avatar answered Dec 05 '22 06:12

eike


You can't prevent the Table from showing its scrollbars if it wants to. However, if you give the table the space it requires, it should not have to display any scrollbars.

Note: You can simply use SWT.NO_SCROLL in the constructor but if you want to update it later it won't be possible.

like image 40
Frettman Avatar answered Dec 05 '22 05:12

Frettman