Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Unwanted shrink of table columns
Unwanted shrink of table columns [message #1083118] Fri, 09 August 2013 13:53 Go to next message
Gosia Stefan is currently offline Gosia StefanFriend
Messages: 2
Registered: August 2013
Junior Member
Hi all.
I have a table:
	
Table table = new Table(myContainer, SWT.BORDER  SWT.V_SCROLL);
			table.setLinesVisible(true);
			table.setSize(100, 100);
			
                        TableLayout tableLayout = new TableLayout();
			tableLayout.addColumnData(new ColumnWeightData(30, false));
			tableLayout.addColumnData(new ColumnWeightData(30, false));
			tableLayout.addColumnData(new ColumnWeightData(40, false));
                        table.setLayout(tableLayout);

			 
		String[] tableNames = new String[] { "", "name1", "name2" };
			
                for (int i = 0; i < tableNames.length; i++) {
		TableColumn column = new TableColumn(table, SWT.NONE);
		column.setText(tableNames[i]);
			}
		table.setHeaderVisible(true);
		final TableColumn[] columns = table.getColumns();



Problem I have is that table columns are shrinking to the left if there is "SWT.V_SCROLL" in the table. If it is not there, then the columns are displayed properly. I have tried to set
column.setResizible(false)
, but it doesnt help. I need to have scroll bar.
Was wonder if you can help me.
Thank you
Re: Unwanted shrink of table columns [message #1083343 is a reply to message #1083118] Fri, 09 August 2013 20:55 Go to previous message
Gosia Stefan is currently offline Gosia StefanFriend
Messages: 2
Registered: August 2013
Junior Member
I figured it out.
If someone wants to know, solution was to add an extra column:
tableLayout.addColumnData(new ColumnWeightData(1, false));

Table columns will not shrink now. It leaves an extra space on the right hand side of the table, but it is fine with me. Smile
Previous Topic:How to sequentialize timerexecs in SWT Display
Next Topic:Problems generating JNI libraries
Goto Forum:
  


Current Time: Fri Apr 26 02:40:00 GMT 2024

Powered by FUDForum. Page generated in 0.02808 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top