Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronized Lists  RSS feed

Nicolas Viollin
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !!
I need to synchronize two list together, i mean, that when i scroll the left one for exemple, then the right one also scroll, when i click on an item on the left list, the the same item on the right list (with the same index) is selected. I've already realised the second point, but i still have problems with the first one !!
here is my current code :
import java.awt.*;
import java.awt.event.*;
import multilist.*;
* Titre :
* Description :
* Copyright : Copyright (c) 2001
* Soci�t� :
* @author
* @version 1.0
public class Cadre extends Frame implements ItemListener, AdjustmentListener{
MultiList m1 = new MultiList();
MultiList m2 = new MultiList();
Panel p = new Panel();
public Cadre() {
setSize(640, 480);
m1.setHeadings(new String[]{""});
m2.setHeadings(new String[]{""});

m1.setColumnSizes(new String[]{"150"});
m2.setColumnSizes(new String[]{"150"});
for (int i=0; i<50; i++){
m1.addTextCell(i,0, "Test" + String.valueOf(i));
m2.addTextCell(i,0, "Tagada" + String.valueOf(i));

p.setLayout(new GridLayout(1,2));
p.add(m1, null);
p.add(m2, null);
public static void main(String[] args){
new Cadre();
public void itemStateChanged(ItemEvent ie){
if (ie.getStateChange() == ItemEvent.SELECTED){
public void adjustmentValueChanged(AdjustmentEvent ae) {
instead of standart List object, i use MultiList Object, but it's exactly the same...
thnx for any help
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!