Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » auto-resizing the column header(code to resize a column header)
auto-resizing the column header [message #947181] Tue, 16 October 2012 22:24 Go to next message
Jay Norwood is currently offline Jay NorwoodFriend
Messages: 155
Registered: July 2009
Senior Member
I noticed that when using large fonts that the default column header heights did not resize correctly. I used this code to fix the problem, based on the faq resize suggestion. It works fine for me. The row headers have similar problems. Maybe the real problem is that there is some hard-coded font size somewhere in the code, but this fixes it.

natTable.addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
cellPainter = new BeveledBorderDecorator(
new TextPainter(false, true, 2, true));

and for Row Headers

natTable.addConfiguration(new DefaultRowHeaderStyleConfiguration() {
cellPainter = new LineBorderDecorator(
new TextPainter(false, true, 2, true));

[Updated on: Tue, 16 October 2012 23:20]

Report message to a moderator

Re: auto-resizing the column header [message #947520 is a reply to message #947181] Wed, 17 October 2012 06:49 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2772
Registered: July 2012
Senior Member

it is not a hard coded font size, it is a different configuration of the row height / column width in the DataLayer. The rendering of the cell bounds doesn't take the font size into account. You have to set this on creating the DataLayer.

Feel free to open a bug if it is necessary that the row height / column width should at least calculated taking the font into account.

Previous Topic:NatTableExamples
Next Topic:Click on column header (select) gives an NullPointerException
Goto Forum:

Current Time: Sun Jan 26 11:12:17 GMT 2020

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

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

Back to the top