Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10792
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Roedy Green <see_website@mindprod.com.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Generics ? |
| Date | Fri, 16 Dec 2011 02:10:43 -0800 |
| Organization | Canadian Mind Products |
| Lines | 43 |
| Message-ID | <ag5me7h7pph1d4n2b05uvgump03dp7ig0t@4ax.com> (permalink) |
| References | <jcem2m$gbm$1@dont-email.me> |
| Reply-To | Roedy Green <see_website@mindprod.com.invalid> |
| NNTP-Posting-Host | Z2l1DcCELS0rATq8NqV4Sw.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| X-Newsreader | Forte Agent 6.00/32.1186 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10792 |
Show key headers only | View raw
On Thu, 15 Dec 2011 21:48:06 -0800, Knute Johnson
<nospam@knutejohnson.com> wrote, quoted or indirectly quoted someone
who said :
>public class KList extends JList {
> ListModel model = new DefaultListModel();
If you were just using JList by itself you would say:
final JList<String> flavour = new JList<String>( new String[] {
"strawberry", "chocolate", "vanilla" } );
Your new class KList can have a built-in fixed contained type, e.g.
String or it can have a variable one.
The first is pretty obvious :
class KList extends JList<String>
The second you can discover by looking for some similar Sun code in
src.zip, e.g.
public interface MutableComboBoxModel<E> extends ComboBoxModel<E> {
so I would think
KList <E> extends JList<E>
should work.
For additional hints, see http://mindprod.com/jgloss/generics.html
and links
I have not tested this and quite commonly things in generics I think
should work do not. Take this just as a hint of something to try.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-15 21:48 -0800
Re: Generics ? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-15 22:03 -0800
Re: Generics ? Tassilo Horn <tassilo@member.fsf.org> - 2011-12-16 08:30 +0100
Re: Generics ? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-16 00:08 -0800
Re: Generics ? Roedy Green <see_website@mindprod.com.invalid> - 2011-12-16 02:10 -0800
Re: Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-16 22:01 -0800
Re: Generics ? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-16 23:30 -0800
Re: Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-17 10:20 -0800
Re: Generics ? markspace <-@.> - 2011-12-17 10:54 -0800
Re: Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-17 11:25 -0800
Re: Generics ? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-12-17 21:20 -0800
Re: Generics ? "Qu0ll" <Qu0llSixFour@gmail.com> - 2011-12-18 21:08 +1100
Re: Generics ? Lew <lewbloch@gmail.com> - 2011-12-18 08:17 -0800
Re: Generics ? markspace <-@.> - 2011-12-18 08:43 -0800
Re: Generics ? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-17 11:33 -0800
Re: Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-17 11:40 -0800
Re: Generics ? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-17 11:47 -0800
Re: Generics ? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-17 15:13 -0500
Re: Generics ? Roedy Green <see_website@mindprod.com.invalid> - 2011-12-17 02:46 -0800
Re: Generics ? "John B. Matthews" <nospam@nospam.invalid> - 2011-12-17 11:18 -0500
Re: Generics ? Knute Johnson <nospam@knutejohnson.com> - 2011-12-17 11:16 -0800
csiph-web