🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3508

Re: getSelectedItem() in listcontrol?

#3508
From: Michelle
Date: Wed, 10 Dec 1997 00:00
21 lines
1164 bytes
Hello,

I tried this, and worked great, thank you!!

However, I now have the problem of trying to view the string I've selected
outside of the for-loop.  For example, how would I show this string
selection in a textFieldControl?

Thanks!!
--Michelle

Joe Nuxoll wrote:

>int[] selectedIndexes = listControl1.getSelection().getAll();
>Object[] data = new Object[selectedIndexes.length];
>for (int i = 0; i < selectedIndexes.length; i++) {
>  data[i] = listControl1.get(selectedIndexes[i]);
>  System.out.println("data at index " + selectedIndexes[i] + " = " +
>data[i]);
>}
Technical Details
Message-ID: <66n5dk$1gr5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34830CC3.B6DF8C40@lehigh.edu> <348323E1.EF814660@corp.borland.com> <66i1c2$bf3@forums.borland.com> <348CF712.AE5B2704@corp.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,d47e4c667b5aa1c4
X-Google-Attributes: gid1089d0,public
From: "Michelle" <clemrill@pacbell.net>
Subject: Re: getSelectedItem() in listcontrol?
Date: 1997/12/10
Message-ID: <66n5dk$1gr5@forums.borland.com>
X-Deja-AN: 297043534
References: <34830CC3.B6DF8C40@lehigh.edu> <348323E1.EF814660@corp.borland.com> <66i1c2$bf3@forums.borland.com> <348CF712.AE5B2704@corp.borland.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: None
Newsgroups: borland.public.jbuilder.java.api