HeaderLineWrapModel doesn't account for icons

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

HeaderLineWrapModel doesn't account for icons

Postby Jason Rising » Thu Apr 21, 2022 1:53 pm

The HeaderLineWrapModel does not factor in any icons that appear in the table header. Re-sizing the table columns then incorrectly resizes the columns and the text is cut off.
As a workaround, I implemented a TableHeaderCellDecorator to do what I wanted using icons so that resizing the table header works like there was no icon. It would be nice if it factored in icons though.

There is also another problem with the header line wrapping cutting off text when we don't expect it to. If one header has a single string value and another has two, we would expect the second to wrap, but instead the header collapses to one row and cuts off the text. As a workaround, I had to create a JViewPort to set a reasonable maximum height given the header line wrap model values of:
Code: Select all
public int getPreferredRows(final int column) {
   return 2;

public int getMaximumRows(final int column) {
   return 3;

public int getMinimumRows(final int column) {
   return 1;

public int getPreferredWidth(final int column) {
   return -1;

I have fought with values that worked for all header values, but some tables just don't wrap correctly when sorting the first column that spans two rows (like "Compare Index").
It would also be nice if there was an option to set the values for a HeaderLineWrapModel to switch between no line wrapping to line wrapping with 1,2,3, etc. rows or fitting the contents of the header to fit exactly without having to increase the view port size of the header while changing the values in the line wrap model. I implemented a table header pop-up to let the user select custom values or select a header wrap option for NO_WRAP, WRAP, FIT, or another called COMFORTABLE with default values and it sort of worked. Once we started increasing the preferred and maximum rows, we also had to adjust the view port to fit the header; otherwise, it would cut off the header and ignore our values.
Jason Rising
Posts: 7
Joined: Thu Jun 24, 2021 10:39 am

Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests