Question: I have to put large amount of text into the `JTable`. When I try to put the text into the `JTable` , it all goes all into a row without breaking a line like :

![enter image description here](https://i.stack.imgur.com/KsH6u.jpg)

and there are no horizontal scroll bars also. Is there any way I can put the text in a new line but on the same row so that all the data is visible.If you notice the snapshot there are dots at the end I cannot see beyond them though there is still some text to be displayed.

I have tried increasing the height of the row but that doesn't help.

*Note :* I have done this in the constructor :

```
jScrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);

```

Answer: 
You can try .Insert() as below:

```
al.Insert(1, "bcd");

```
EDIT: You can't directly insert based on an index in a List, you can only Set(Modify)/Get a value to an index. **If it exists**

---

You can use indexing with an ArrayList as well, but use a Generic [List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) instead of ArrayList. Its type safe. and Also support insertion based on index.

With `ArrayList` you can use the index

```
List<string> list = new List<string>();
list.Add("first element");
list.Add("2nd element");

Console.Write(list[0]);
Console.Write(list[1]);

list[0] = "AAA - element"; //In actual its a modification, 
                           //if there is no element, there will b exception
list[1] = "BBB - element";

```

Remember you can't directly set element of a list based on an index.