🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7380

datatype question.

#7380
From: benutzer
Date: Mon, 25 Jun 2001 15:51
24 lines
2015 bytes
hi i have some problems finding the appropriate datatype for the task i
want my applet to do. i get pairs of two values from a DB-table (
"item_id" and "item_name"). I display the names in a JList-Component via
a DefaultListModel-Class.

Now I want to give the user the opportunity to select one or more names
from the ListBox and start doing something with the Items, based on
their ID ( not the index in the List, but the DB-id I got in the
beginning. Is there an elegant way to store the both values TOGETHER,
and may be pass the names to the ListBox ? So what i would need to do
is, somehow keep the association between the string in the list box and
it's original item_id in the database.

I was working with Delphi a lot, so my thoughts are inspired by Delphis
helper-Classes, providing listtypes that have methods like .isInList(
Key : String ... ) : Bool. I am very new to Java and don't have an indea
of all the classes out there in the JDK, so I would be happy for anny
suggestion about selecting the right types for my problem .

Hope I could make myself clear ...

Regards

Markward Schubert
Technical Details
Message-ID: <3B375DF7.216CBE7D@besteshop.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,1dc455942037281f,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-25 09:06:31 PST
Message-ID: <3B375DF7.216CBE7D@besteshop.de>
Date: Mon, 25 Jun 2001 17:51:20 +0200
From: benutzer <benutzer@besteshop.de>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de,en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: datatype question.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 212.184.124.174
X-Trace: dnews 993484327 212.184.124.174 (25 Jun 2001 08:52:07 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews