Results 1 to 2 of 2
  1. #1
    nayeem is offline Member
    Join Date
    Nov 2016
    Posts
    8
    Rep Power
    0

    Default How i can get integer value from jcombobox select items and how to write that in

    HOW I CAN GET INTEGER VALUE FROM JCOMBOBOX SELECT ITEMS AND HOW TO WRITE THAT INTEGER VARIABLE IN SQL INSERT QUERY STATEMENT FOR ADD THAT JCOMBOBOX SELECT ITEM INTEGER VALUE IN DATABASE.GIVE ME SOME EXAMPLE>
    JUST LIKE THIS CODE:
    int Bookcredit=(Integer)(ComboBookcredit.get SelectedItem());
    now, how can i insert this integer variable in sql insert statement.?
    Attached Thumbnails Attached Thumbnails How i can get integer  value from jcombobox  select items  and  how to write  that in-untitled.png  
    Last edited by nayeem; 11-11-2016 at 04:00 PM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: How i can get integer value from jcombobox select items and how to write tha

    What data type does the get SelectedItem method return? Look at that and then see if there are any methods in any classes that will convert that data to the data type you want. For example if a String is returned, the Integer class has a method to parse that String to an int value.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 8
    Last Post: 12-10-2011, 04:54 PM
  2. Replies: 2
    Last Post: 02-03-2011, 05:19 AM
  3. Databse items to Jcombobox
    By pra.deep in forum AWT / Swing
    Replies: 6
    Last Post: 09-17-2009, 10:50 AM
  4. how to save added items in jcombobox
    By kwink in forum AWT / Swing
    Replies: 2
    Last Post: 03-22-2009, 06:03 PM
  5. Adding items to a jComboBox
    By tronovan in forum New To Java
    Replies: 0
    Last Post: 08-08-2007, 08:48 AM

Posting Permissions

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