F
freesoft_2000
Hi everyone,
I have three JLists in three individual JScrollPanes.
All the objects in the JLists are equal in size
What i need to is when i select an object in a certain JList, the index
second and third JList is selected and also the JScrollPane is supposed to
automatically scroll to that position so that the selected indices are
visible by the user
This is how far i have gotten so far.
The selection part is already done but i can't get the individual
JScrollPanes of the second and thirs JLists to scroll to the part that is
being selected in the first JList
I am listing what is in the ListSelectionListener
public void valueChanged(ListSelectionEvent evt)
{
JComponent d = (JComponent)evt.getSource();
if(d == List1)
{
//The below three command lines sets the selected indices of List2 and
List3
//according to the selected indices of List1
int[] k = List1.getSelectedIndices();
List2.setSelectedIndices(k);
List3.setSelectedIndices(k);
}
Please assume the first JList is called List1, the second List2 and the
third
List3
Some sample coding would be helpful
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West
I have three JLists in three individual JScrollPanes.
All the objects in the JLists are equal in size
What i need to is when i select an object in a certain JList, the index
second and third JList is selected and also the JScrollPane is supposed to
automatically scroll to that position so that the selected indices are
visible by the user
This is how far i have gotten so far.
The selection part is already done but i can't get the individual
JScrollPanes of the second and thirs JLists to scroll to the part that is
being selected in the first JList
I am listing what is in the ListSelectionListener
public void valueChanged(ListSelectionEvent evt)
{
JComponent d = (JComponent)evt.getSource();
if(d == List1)
{
//The below three command lines sets the selected indices of List2 and
List3
//according to the selected indices of List1
int[] k = List1.getSelectedIndices();
List2.setSelectedIndices(k);
List3.setSelectedIndices(k);
}
Please assume the first JList is called List1, the second List2 and the
third
List3
Some sample coding would be helpful
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West