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);
精彩评论