JTable根据Data调整列宽和行宽

发布于 2024-09-15 21:29:56 字数 179 浏览 0 评论 0原文

我需要在 Jtable 单元格中显示以下数据。到目前为止,即使我用换行符覆盖对象的 toString 方法,所有内容都在一行中。如何设置 Jtable 来调整单元格高度和宽度,具体取决于数据上。

Segment ID: 1  
Elevation : 2.0 
Azimuth :30.0  

I need to show the below data in a Jtable cell.As of now everything comes in a single line even-though i'm overriding the object's toString method with newline characters.How can I set the Jtable to adjust the cell height and width depending on the data.

Segment ID: 1  
Elevation : 2.0 
Azimuth :30.0  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2024-09-22 21:29:56

尝试在 JTable 单元格中嵌入 JTextArea 对象

Try to embed a JTextArea object within a JTable cell

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文