JTable多行单元格自动换行 [英] JTable Multiline cell Auto wrap

查看:123
本文介绍了JTable多行单元格自动换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java开发医院管理系统应用程序,我有非常长的文本的ICD-10代码,我想用jtable显示它们,但是由于文本太长,我需要JTable单元格根据需要包装文本;根据需要更改该行的高度.

Im developing Hospital Managment System Application using java, i have ICD-10 codes with a very long texts, i want to show them with jtable, but since the text is too long i need the JTable cell to wrap text as needed & change the hieght of that row as required.

有什么想法,或者有其他建议吗?

is there any idea how to do that, or any other suggestions if there is.

推荐答案

考虑将表中的全文显示在相邻的JTextComponent中,而不是将表中的每一行都包含换行符,以使表整齐.由于 ICD-10 本质上是分层的,因此也请考虑轮廓视图,如下所示此处.

Rather than clutter the table with wrapped text in each row, consider displaying the full text in an adjacent JTextComponent only for the selected row. Because ICD-10 is hierarchical in nature, also consider an outline view, as shown here.

这篇关于JTable多行单元格自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆