Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronized Lists

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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic