<Swing Dev> [11][JDK-4842658] RFR: DefaultListModel and DefaultComboBoxModel should support addAll (Collection c)

Krishna Addepalli krishna.addepalli at oracle.com
Mon Apr 9 07:10:14 UTC 2018


Hi All, 

 

Please review a simple fix for enhancement:

JDK-4842658: https://bugs.openjdk.java.net/browse/JDK-4842658

Webrev: http://cr.openjdk.java.net/~kaddepalli/4842658/webrev00/

CSR: https://bugs.openjdk.java.net/browse/JDK-8201289

 

Currently, there is no way to add a set of items directly to a DefaultListModel and DefaultComboBoxModel classes, other than looping over it and adding one by one.

This results in generation of unnecessary events, which mostly are ignored and also slow. Instead, if the api was added to receive a collection of items, then one event would be generated for all the items that get added to the model, 

While also reducing the boilerplate code on the application side.

 

Thanks,

Krishna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20180409/9d56cd7c/attachment.html>


More information about the swing-dev mailing list