开发者

scrolling messes up the header in jtable when using non default header height

开发者 https://www.devze.com 2023-02-08 17:35 出处:网络
I change the height of header in jtable with this: mytable.getTableHeader().setPreferedSize(new Dimension(mytable.getColumnModel().getTotalColumnWidth(), 34));

I change the height of header in jtable with this:

mytable.getTableHeader().setPreferedSize(new Dimension(mytable.getColumnModel().getTotalColumnWidth(), 34));

And now, when i use horizontal scrollbar, the header doesn't get rendered correctly at all. What am i doing wrong? This is the only line that affects the problem. Do i need to do anythi开发者_如何学Pythonng else to change the height of the header?

Here is the screenshot of the problem. Look at right of the header...


Dimension d = table.getTableHeader().getPreferredSize();
d.height = 34;
table.getTableHeader().setPreferredSize(d);
0

精彩评论

暂无评论...
验证码 换一张
取 消