This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Display value and Actual value in JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Display value and Actual value in JComboBox" Watch "Display value and Actual value in JComboBox" New topic
Author

Display value and Actual value in JComboBox

kashwini Kulkarni
Ranch Hand

Joined: Aug 07, 2009
Posts: 63
Hello,

I want to display values from my database in a JComboBox, where the item being displayed must be the name and the value of the item must be the Srno (primary key) .

Is there any way to display two values in JComboBox ( same as SELECT in HTML) where one being displayed and other being just the value.




Thanks in Advance
KAshwini

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
If I understand the question then try this:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display value and Actual value in JComboBox
 
Similar Threads
JComboBox and "long" items rendered via HTML
A question about JComboBox
dynamic applet
Dynamically updating JComboBox contents
JComboBox and Mac