Setting uniform width of a table
- From: Mark <Mark.Fenbers@xxxxxxxx>
- Date: Thu, 24 Jan 2008 13:22:25 -0500
I'm baffled as to how to set column widths to be a size I want (using SWT/Jface).
My code is basically this:
tv = new TableViewer(parent,SWT.FULL_SELECTION);
-snip-
table = tv.getTable();
-snip-
tc1 = new TableColumn(table,SWT.CENTER);
tc1.setText("Col 1");
tc1.setWidth(150);
tc2 = new TableColumn(table,SWT.CENTER);
tc2.setText("Col 2");
tc2.setWidth(150);
-snip-
But the setWidth(150) seems to be ignored (on my RHEL4 box), and the table appears with its own idea of what the widths should be (which is not uniform). I've seen the use of setWidth() in other sample Java code, and I've set mine up the same way, but it doesn't work. What am I doing wrong? The bottom line is that I want all my columns in the table to be same width, so maybe setWidth() is not the ideal way of accomplishing this...
Your thoughts?
Mark
.
- Follow-Ups:
- Re: Setting uniform width of a table
- From: Daniele Futtorovic
- Re: Setting uniform width of a table
- From: Roedy Green
- Re: Setting uniform width of a table
- From: Roedy Green
- Re: Setting uniform width of a table
- Prev by Date: javafx + RCP integration - help pls
- Next by Date: Re: open another jframe
- Previous by thread: javafx + RCP integration - help pls
- Next by thread: Re: Setting uniform width of a table
- Index(es):