简体   繁体   English

多行增加单元格高度,Jtable中没有滚动条

[英]Increasing Cell Height with multiline,without Scrollbar in Jtable

Hai I am developing a standalone application using Java in which I am using a JTable.The problem is when I enter a multiline text,the entire text is not displayed in the cell while I am typing.I get a scroll when I type a multiline text.How can I get my whole text to be visible while I type.ie How can I increase my Cell width in JTable while I am Typing . Hai我正在使用Java开发一个独立的应用程序,其中使用了JTable。问题是当我输入多行文本时,键入时整个文本未显示在单元格中。当我输入多行文本时会出现滚动text.Type时,如何使整个文本可见。ie在键入时如何增加JTable中的Cell宽度 But the entire text will displayed only when I click out of that Cell.Can someone help me how to solve this problem 但是仅当我单击该单元格时才会显示整个文本。有人可以帮助我解决此问题吗?

Thank You Chaithu 谢谢柴胡

You should try a custom TableCellRenderer with JTextArea for example. 例如,您应该尝试使用带有JTextArea的自定义TableCellRenderer For typing you'll probably need similar TableCellEditor . 对于键入,您可能需要类似的TableCellEditor

An example can be seen at Java Specialists' Newsletter : Multi-line cells in JTable in JDK 1.4+ . 可以在Java专家的时事通讯中看到一个示例:JDK 1.4+中JTable中的多行单元

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM