Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16067

Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues()

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues()
Date Tue, 17 Jul 2012 11:32:08 -0400
Organization A noiseless patient Spider
Lines 32
Message-ID <ju40d7$csr$1@dont-email.me> (permalink)
References <34011151-6528-4f4c-815c-df9e8353cb71@googlegroups.com> <ju1shj$88s$1@dont-email.me> <_40Nr.24747$cE7.24028@newsfe13.iad>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 17 Jul 2012 15:29:43 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="dbab98bdd12434f87ad48400212f412c"; logging-data="13211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jflJQoYdfd3Z4GhYCfIE1265f8CddlE0="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120613 Icedove/3.0.11
In-Reply-To <_40Nr.24747$cE7.24028@newsfe13.iad>
Cancel-Lock sha1:4gXtXr0UkbzmfcAQoX2nt+qySKw=
Xref csiph.com comp.lang.java.programmer:16067

Show key headers only | View raw


On 07/16/2012 05:55 PM, Daniel Pitts wrote:
> On 7/16/12 1:13 PM, Jeff Higgins wrote:
>> On 07/16/2012 03:53 PM, clusardi2k@aol.com wrote:
>>> Hello, can anyone give me a simple/complete example to replace
>>> jLst.getSelectedValues() below using jLst.getSelectedValuesList().
>>>
>>> Object str_array [];
>>>
>>> if ( !jLst.isSelectionEmpty() )
>>> {
>>> str_array = jLst.getSelectedValues();
>>>
>>> System.out.println("Selected: " + str_array[0]);
>>> }
>> I think the java.util.List<E> interface has a method to return an array.
>>
> Indeed it does, but that is terrible advice.
>
> jList.getSelectedValuesList().get(0) is equivalent to
> jList.getSelectedValues()[0];
>
Is a jList equivalent to a jLst?
Are either of them equivalent to a javax.swing.JList?

Upon further reflection, it seems to me that the only correct answer to 
clusardi2k@aol.com's question is "no" and that any /advice/s given under 
the assumption that a jLst is meant to indicate a javax.swing.JList are 
equally terrible. One is free to comment on the apparent absurdity of 
the code provided, but those comments are better addressed to the 
original poster of the code rather than to another respondent whose 
/advice/ is as terrible as one's own.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using getSelectedValuesList() instead of the deprecated getSelectedValues() clusardi2k@aol.com - 2012-07-16 12:53 -0700
  Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Jeff Higgins <jeff@invalid.invalid> - 2012-07-16 16:13 -0400
    Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-16 14:55 -0700
      Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Jeff Higgins <jeff@invalid.invalid> - 2012-07-16 19:47 -0400
        Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() markspace <-@.> - 2012-07-16 18:05 -0700
        Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Lew <lewbloch@gmail.com> - 2012-07-16 19:46 -0700
          Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Jeff Higgins <jeff@invalid.invalid> - 2012-07-17 07:38 -0400
            Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Steven Simpson <ss@domain.invalid> - 2012-07-17 13:45 +0100
              Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Lars Enderin <lars.enderin@telia.com> - 2012-07-17 19:46 +0200
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-17 20:47 +0200
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-17 12:26 -0700
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Lew <lewbloch@gmail.com> - 2012-07-17 14:16 -0700
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Joerg Meier <joergmmeier@arcor.de> - 2012-07-18 16:08 +0200
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-18 21:33 +0000
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-18 23:36 +0200
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-18 21:53 +0000
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-07-19 00:12 +0200
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() markspace <-@.> - 2012-07-18 15:53 -0700
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-18 16:18 -0700
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Gene Wirchenko <genew@ocis.net> - 2012-07-18 18:06 -0700
                Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-18 23:44 +0000
      Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Jeff Higgins <jeff@invalid.invalid> - 2012-07-17 11:32 -0400
  Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-07-16 14:12 -0700
  Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Lew <lewbloch@gmail.com> - 2012-07-16 14:12 -0700
  Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Jeff Higgins <jeff@invalid.invalid> - 2012-07-17 07:29 -0400
  Re: Using getSelectedValuesList() instead of the deprecated getSelectedValues() Roedy Green <see_website@mindprod.com.invalid> - 2012-07-17 09:30 -0700

csiph-web