I have a JList of elements that are in a specific order. I already have a method that let's me remove things from any position within the JList while maintaining the integrity of the JList. The problem is that I also want to be able to add things at any given position in the JList. For example, let's say I have the following JList like so . . .
AAAA BBBB DDDD
Let's say I have a String element "CCCC" and I want to insert it into position 3 within the JList. I want to have an interface that will looking something like this so I can right click on the position where I want to insert the element. Example, where ---- stands for some kind of seperator that I can click on to select where I want the element to go . .
---- AAAA ---- BBBB ---- <---- I want to insert the element in here. DDDD ----
I also want to insert the same seperator around the newly inserted element like so . . .