API Compatibility with ArrayList

EventList implements the same List interface as ArrayList and Vector. There's less to learn and it will be easy for other programmers on your team to understand.

Simple usage of EventList

    List myEventList = new BasicEventList();


    myEventList.add("Donkey Kong");

    myEventList.add(0, "Bowser");


    myEventList.remove("Donkey Kong");

    if(myEventList.contains("Sonic")) {



    for(Iterator i = myEventList.iterator(); i.hasNext(); ) {




Easy TableModels

EventTableModel allows you to use an EventList for the rows of your JTable, and leaves you responsible to define the columns.

EventList defines the rows

    EventList rows = new BasicEventList();





TableFormat defines the columns

 public class ColorTableFormat implements TableFormat {

    public int getColumnCount() {

        return 3;


     public String getColumnName(int column) {

        if(column == 0) return "Red";

        else if(column == 1) return "Green";

        else return "Blue";


     public Object getColumnValue(Object baseObject int column) {

        Color color = (Color)baseObject;

        if(column == 0) return color.getRed();

        else if(column == 1) return color.getGreen();

        else return color.getBlue();



...and build a table

    ColorTableFormat columns = new ColorTableFormat();

    EventTableModel tableModel = new EventTableModel(rows, columns);

    JTable colorsTable = new JTable(tableModel);

Easy Dynamic Filtering

You can create a filtered copy of an EventList that responds to changes in the original. The filtered EventList listens for events from the original and updates itself as they happen.

Filter for "Found" and "New"

    EventList everything = new BasicEventList();

    TextFilterList filtered = new TextFilterList(everything);

    filtered.getFilterEdit().setText("Found New");




    everything.add("New Found Glory");

    everything.add("A Simple Plan");    

     // should print "[NewfoundLand, New Found Glory]"


Easy Dynamic Sorting

You can create a sorted copy of an EventList that responds to changes in the original. The sorted EventList listens for events from the original and updates itself as they happen.

Sort some Flintstones

    EventList flintstones = new BasicEventList();

    EventList sorted = new SortedList(flintstones);    






     // should print "[Bam-Bam, Barney, Fred, Pebbles, Wilma]"


Layer Multiple Transformations

Layering transformations like sorting and filtering makes it easy to implement powerful manipulations of your data.

Sort and filter some cars

    EventList cars = new BasicEventList();

    EventList sorted = new SortedList(cars);

    TextFilterList filtered = new TextFilterList(sorted);




    cars.add("Prius Hybrid");

    cars.add("Jetta TDI");

    cars.add("Escape Hybrid");



    // should print "[Escape Hybrid, Prius Hybrid]"


High Performance

The EventList fires events that provide fine-grained detail describing the change. This is the secret to making Glazed Lists high performace. When you insert 5 elements into a SortedList containing 10,000 elements, only the new elements get sorted! Competing toolkits sort the entire list on every change.

Designed for concurrency

You can populate your EventList from one thread and read it from another. For GUI applications, you can populate your EventList on a background thread while safely browsing it using the user-interface thread.

Populate on a background thread

 public class UpdateListTask extends TimerTask {

     private EventList target;

     public UpdateListTask(EventList target) {

        this.target = target;


     public void run() {

        Collection results = doSomeReallySlowOperation();







Swing or SWT

You can use either Swing or SWT out of the box.

Includes useful transformations

You can take advantage of some built-in transformations that are more fun than sort & filter.

You can create filters that are appropriate for your data.

Filter everything but four-letter words

public class FourLetterMatcher implements Matcher {

    public boolean matches(Object element) {

        String word = (String)element;

        return (word.length() == 4);



Demonstrate FourLetterMatcher

    EventList normalList = new BasicEventList();

    Matcher fourLetterMatcher = new FourLetterMatcher();

    FilterList fourLetterWords = new FilterList(normalList, fourLetterMatcher);







    // should print "[Nice, Good]"


Easy custom transformations

You can create transformations that are appropriate for your data.

Add "Eh" to all elements, Eh?


public class CanadianList extends TransformedList {

     public TransformedList(EventList source) {




     public void listChanged(ListEvent e) {



     public Object get(int index) {

        return source.get(index) + " Eh?";



Demonstrate CanadianList

    EventList normalList = new BasicEventList();

    EventList canadian = new CanadianList(normalList);    




     // should print "[Moose Eh?, Beaver Eh?, Beer Eh?]"


Free and open