Hi, I am creating a JTable, with a default column width. Is there any way I can specify the row width. Also when my text is longer than the column width the text shows as "My text...." Is there any way I can set the cells so that when the text is longer than the column width, the row size increases and the text gets displayed (Something like the AutoLineWrap). Thanks a lot
Hi susmita, To wrap the text in your cell u'll have to make use of a renderer. what u need to do is write a renderer that extends JTextArea (so that u may have multiple lines in your cell). and then use setLineWrap(true); setWrapStyleWord(true); method to make sure that the text gets wrapped. Once the renderer is ready set this renderer for every table column. here is an example of multilinerenderer
in case u need more help do post back regards deeksha
posted 19 years ago
Thanks a lot deeksha. It works.
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop