Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Snippet77 simplification

I've been playing around with tables and I have found a much simpler
way to get the same effect as Snippet77, instead of adding to the
composite I added the listener directly to the table:

		table.addControlListener(new ControlAdapter() {
			public void controlResized(ControlEvent e) {
				Rectangle area = table.getClientArea();
				column1.setWidth(area.width / 2 - 2*table.getBorderWidth());
				column2.setWidth(area.width / 2 - 2*table.getBorderWidth());
			}
		});

seems to work automatically with or without the scroll bar.

Cheers,
Benjamin

-- 
/*  http://www.benjaminranck.com */


Back to the top