aspose file tools*
The moose likes Beginning Java and the fly likes Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter" Watch "Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter" New topic
Author

Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter

Declan Dee
Greenhorn

Joined: May 04, 2010
Posts: 20
Hi Gents,

In desperate need of help

I need to do the following

I need to select from a range of values (via a regular resultset) and show this information in a Drop Down List - I succeded

Now I need to show in a JList ONLY values that are linked to what is currently selected in the combox, that are coming out of a MySQL database and I am already over 6 hours doing it

So basically when I select an option for example 'dance' or 'circus' in the drop down list. I need to get ONLY what is linked with 'Circus' in the MySQL database (via the code I have shown)

The MySQL code is fine. Currently the Prep statement is 'prepStatement.setString (1,"Dans");' This means that no matter what I select in the main drop down list, I will only get what is linked 'Dans' and not the other genres.

I tried with this but to no avail:


Here is the code, showing the two methods. The first method works fine when called. It makes a dropdown list with just Genres.

The second however...........



I would be very grateful if someone could help

Declan D
Declan Dee
Greenhorn

Joined: May 04, 2010
Posts: 20
Just getting back. The code is actuall this:



This gives you the value of what is currently selected in the Combobox. That was the problem all along.

The rest

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter