且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在jtable单元格中包装行?

更新时间:2023-12-03 11:57:16

问题是JTable中行的高度是固定,所以这不仅仅是渲染渲染器的问题;我不确定它为什么没有,但如果确实如此,那么包装好的文字会被裁剪掉 - 或许这正是你所看到的。要调整行高,您需要单独设置它们。

The problem is that the height of rows in JTable is fixed, so it's not just a matter of having a renderer that wraps; I'm not sure why it doesn't, but if it did, the wrapped text would be cropped - or maybe that's exactly what you're seeing. To adjust row heights, you need to set them individually.