*
The moose likes JDBC and the fly likes How do I get a string from an item in a dynamic jlist? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How do I get a string from an item in a dynamic jlist?" Watch "How do I get a string from an item in a dynamic jlist?" New topic
Author

How do I get a string from an item in a dynamic jlist?

csnowbar
Greenhorn

Joined: Mar 07, 2001
Posts: 5
I am using Forte for Java Internet Edition to write an application that uses an nbCacedRowset from a database query at runtime to dynamically populate a jlist. Next to the jlist is a panel of text fields that needs to be dynamically populated with information from the same database depending on what item in the jlist is focused on. More specifically, items in the jlist are pieces of equipment whose corresponding status/information is to be displayed next to it in a status panel. Understand? Is there some way that I can return the value or string from the focused item in the jlist to be used in a query to populate the text fields in the status panel? Any help you could give me would be appreciated. I'll attach the code below for reference.
Thanks,
Craig

[This message has been edited by csnowbar (edited March 07, 2001).]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
Use the JList.getSelectedValue method and provide a ListSelectionListener that will retrieve the selected value anytime the user changes.
Hope this helps.
David
 
 
subject: How do I get a string from an item in a dynamic jlist?
 
Similar Threads
How do I get a string from an item in a dynamic jlist?
Setting checkbox from database.
how to create input fields dynamically in struts
How do I get a string from an item in a dynamic jlist?
How do I get a string from an item in a dynamic jlist?