A system and method are disclosed whereby a list-based control (e.g., a
Listbox or Choice control) in a graphical user interface may share a
single copy of a list with the peer component of the control in the
application program interface (API) used to display the control. This
overcomes a problem in legacy Java applications, based on the abstract
windowing toolkit API, wherein the peer component creates a copy of the
list when the corresponding list-based control is displayed. In contrast,
peer components within the Swing API reference the original version of
the list associated with the control, avoiding this redundancy. According
to the system and method disclosed herein, an enhanced version of Swing
can be used with legacy application programs, allowing them to benefit
from this feature of Swing. No modification of the legacy code is
necessary. This extension to Swing is referred to herein as AWTSwing.