jjczopek
jjczopek

Reputation: 3379

Multi-line table cell

I have an JTable component where I display some data. One of my column is a string, which is too long for my cell. How can I make cells in that column multi-line?

Upvotes: 1

Views: 2525

Answers (2)

Perception
Perception

Reputation: 80603

There are some examples on the Internet about how to do this. Seems like its a pretty common task developers try and accomplish with JTables. Basically what you want to do is implement your own cell editor using AbstractCellEditor/JTextArea. Heres a link to one such example with source code:

http://www.jroller.com/santhosh/entry/multiline_in_table_cell_editing1

Upvotes: 2

mKorbel
mKorbel

Reputation: 109813

put into TableCell f.e. JTextArea or another JComponents that allows multiline output

Upvotes: 3

Related Questions