Monday, November 23, 2009

News - Swing-Generics (OpenJDK): JList patch commited

Great news from the OpenJDK swing-generics project: my patch to "generify" JList, along with AbstractListModel, DefaultListCellRenderer, DefaultListModel, ListCellRenderer and ListModel, has been commited to the OpenJDK/ Swing repository!

This patch helps writing more stable code.

Eg. instead of writing something like:

with this patch you can write now:

Note that:
JList.getSelectedValues(): Object[] has been deprecated and replaced with:
JList.getSelectedValuesList(): List<E>

Have a look at the jtreg tests to see more examples.

If you're interested in the future of Swing, join the discussions in the OpenJDK Swing mailing list.