Results 1 to 4 of 4
  1. #1
    imless is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Get ID in populated combobox with data from database

    Good evening friends. I am planning to populate a combobox with datas from my database(Ms Access) but the problem is how should I get its ID for storing purpose only. To those who know it, please help. Thank you.

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,233
    Rep Power
    7

    Default Re: Get ID in populated combobox with data from database

    Not sure I understand the question, but maybe this will help: Combo Box With Hidden Data « Java Tips Weblog

  3. #3
    imless is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Re: Get ID in populated combobox with data from database

    Sorry if its not clear question. What I want is I will populate my combo box with data's from my database then when I run the program [with GUI], as I change the index or the value or my combo box, I can see it's ID. Like for example, itemnames(one, two, three) with ID's (1,2,3). When I choose one in my combo, 1 will appear in message box or in text or in label.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Get ID in populated combobox with data from database

    Read the API for JComboBox and follow the link to the tutorial on How to Use Combo Boxes where you will learn how to perform an action when the selection is changed.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 0
    Last Post: 08-11-2013, 04:48 PM
  2. Combobox selections in to a database
    By MonkeyMan in forum New To Java
    Replies: 1
    Last Post: 03-05-2012, 04:25 PM
  3. Replies: 1
    Last Post: 08-12-2011, 05:55 AM
  4. No values from database in Combobox
    By aborgeld in forum New To Java
    Replies: 3
    Last Post: 01-01-2011, 08:38 PM
  5. ComboBox with database options
    By Goldy in forum Advanced Java
    Replies: 0
    Last Post: 12-01-2007, 09:43 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •