Java JLists again
I've been reading the previous entries on Java and JLists ( or ListBoxes as Robot identifies them ) with interest as we are having a particular problem with identifying items within the lists. I apologise for the technicalities here but it is the only way I can describe the problem.
We have a stand alone Java application with a Swing JList on a panel in which we want to be able to uniquely identify an item within the list with a unique name rather than it's index. This is so if we change the order of the lists we do not have to change any scripts. To display our list items however, we use our own Cell Renderer so we can display an image and text as an item in the list. This renderer is a JPanel. When we create our Cell Renderer we use the setName property of the JPanel to give it a unique name, like we do with our other components, to enable Robot to identify it. However, Robot can pick up all our other components except the JPanels within the listbox. We have also tried using the getAccessibleContext().setAccessibleName to see if Robot can pick this up but to no avail. If we use the default Swing Cell Renderer, which returns a JLabel, then Robot can identify it by its name property fine.
We were wondering whether any one out there has come across this problem before when using renderers to display items in the list and whether they were able to overcome this.
Thanks in advance.