Retrieving item from JCombobox

hi,
I am populating a jcombobox from a database table.
the combobox accepts and displays "last name, First name ID #"
I want to separate out and retrieve only the ID # so that I can run a report based on the selected ID #.
The following code will pull the entire string but I need to 'grab' the ID # separately.
jcmbPharmacist.getSelectedItem().toString();
Can someone assist me?
Thank you

In the future, you should post Swing related questions in the Swing forum.
For an example of storing an Object in a combo box check out this posting:
http://forum.java.sun.com/thread.jspa?threadID=608684&messageID=3327290

Similar Messages

  • Can i retrieve items from time machine into mavericks

    Dear people
    I am looking to install mavericks but don't want to do a clean install, ( i will if it messes my machine up though ).
    If i install mavericks i take it that;
    A: all the apple apps will still work.
    B: if it is messed up then i wil be able to retrieve items from time machine back up.
    C: is it worth doing a seperate back up to a hard drive other than by time machine.
    D: i previously installed my last software via a clean install, as the upgrade to mountain lion messed up my emails
    is it better to do a clean install or are the problems with email boxes etc not relevant in this up date.
    Thank you

    All the Apple apps will still work- that's a very positive, hopeful statement. Probably they will.
    You should be able to retrieve something from your TIme Machine backup. Yes.
    A duplicate backup: it depends on how criticially important your data is, and how paranoid you are. One backup is good enough for me.
    I am a fan of the clean install. However, I did not do one this time with Mavericks. Lazy. But it works fine.
    I would suggest that you restart in safe mode, though, before running the installer. I couldn't get the installer to work until I did.
    Regarding a clean install vs. an update install, I think you are asking the wrong question. My opinion is that the vast majority of problems that people have with their Macs are due to:
    crapware. I will elaborate on this if you want more. If not, stop reading now.
    Crapware = unneeded "haxies", "cleaners", "optimizers", "defragmenters", antivirus software, and GUI modifiers. These are usually poorly written, typically ports from the Microsoft world. They are unnecessary and usually cause problems. They can be impossible to uninstall. They are popular with recent converts from the Microsoft world. I avoid them. My mac almost never, ever has any kind of problem, and I use it a lot, and not just for word processing and checking my email. I do audio recording and editing and some video editing too.
    So I do not think the problems people report are due to the OS itself. People want to blame the OS, but I think it's unreasonable for Apple to be able to control and supervise every software developer on the planet.
    I would suggest: if you have crapware on your computer, do a clean install, and then don't reinstall the crapware. Just my 2 cents.
    If you don't have crapware, the Mavericks upgrade will probably work fine.
    a good backup, Time Machine or otherwise, is always a good idea, especially when installing a new OS.

  • How to retrieve items from Windows Explorer like My Computer?

    How can a java program retrieve item names in the Windows Explorer directory structure [i.e. items in the left pane like Desktop, My Computer, Printer, Control Panel, Dial-up Networking etc.]. I retrieved all the drive names and directories using java.io.File class and displayed using JTree.

    I don't believe that a lot of those items are actually "files" and directories, if you use the "dir" command in a DOS box from your Desktop I don't think you can find them...if you can then they are files etc...
    Since stuff like "Control Panel" is OS specific (i.e. Windoz) then Java wouldn't support it in the core API...

  • Read item from Jcombobox to jtextarea

    Hi Guys,
    Pls how do i read a selected item from a jtextbox into a jtextarea.
    i've tried using the getText & the getSelecteditem methods but i keep getting errors.
    ie.
    display.append(name.getText());
    display.append(name.getSelecteditem());
    name is the jcombobox

    display.append(name.getText());
    there is no getText() method for JComboBox, unless your cb is editable,
    then you need to get the editor component, not the comboBox, and use getText()
    display.append(name.getSelecteditem());
    textArea.append(..) takes a string as its argument
    name.getSelecteditem() returns an object
    try
    display.append((String)name.getSelecteditem());

  • Using Content search web part to retrieve items from another site collection

    I have a web application that contains two site collections(team site + enterprise wiki), with the following URLs:-
    -http://applicationname/teamsite
    -http://applicationname/enterprisewiki
    Now I need to display the latest 10 wiki pages from the enterprise wiki site collection(according to the modified date) inside the team site. So I read that using Content search web part allow for cross-site content query. Currently I added a new content
    search web part , inside my team site, and I click on “change query” button. But I am not sure how I can reference the enterprise wiki site collection's wiki page library and to specify that I need to get the latest 10 wiki pages , inside the following dialog:-
    Basically this setting partially worked for me, I provide the following settings inside the “Build Your Query” dialog:-
    From the “Select a Query” I defined the following:- “items matching content type(system).”
    Restrict by app : “Do not restrict results by app”
    Restrict by content type “Enterprise Wiki Page”.
    This showed all the sites, lists and even pages are based on the “Enterprise Wiki Page” content type. But I am facing these three problems:-
    1. The above setting showed only the sites,lists and pages matching the “Enterprise Wiki Page” content type, that exists on another web application, and not that exists inside the current web application.
    2. To test the web part , I got the following results, But I was not able to add additional info for the items such as created by, modified by ,etc.
    3.  Also there is no way to sort the wiki pages by the modified date, as in the Sorting tab inside the “Build Your query” dialog I cannot find the “modified” inside the Soft by list
    So can anyone advice how to fix these three problems

    Hi,
    1. In "Build Your Query" dialog, we can select "Specify a URL" in
    Restrict by app and enter another site URL.
    2. If you want to add more information for the items, we need customize the display template, the following link for your reference:
    http://blogs.technet.com/b/sharepoint_quick_reads/archive/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-1.aspx
    3. In the Sorting tab, we can use "LastModifiedTime" to instead of "Modified".
    Best Regards 
    Dennis Guo
    TechNet Community Support

  • Get , store and retrieve values from JComboBox, JT.......

    please can you show me how to collect informations from some JComponents like JComboBox, JList , JTextField, JTextArea etc and store them on clicking on a single button and also retreiving them by clicking on another single button

    below are some functions that u can use:
    JComboBox: getSelectedItem()
    JList: getSelectedValue()
    JTextField, JTextArea: getText()
    basically u need to have button, add an action listener for the button, and store the value using the above functions when the button is clicked.
    hth.

  • I have a LaCie external hard disk. I do not know how to retrieve photos from iphoto that have disappeared. I do not know how to use Time Machine

    I have a LaCie external hard drive. I also have Time Machine. I somehow have "lost" almost all my 5,000+ photos from iPhoto 8.1.2. I would appreciate someone giving me directions on how to retrieve the photos from the external hard drive or Time Machine.
    The last thing that I did that is different from my normal routine was to trash duplicate music tunes from iTunes. I cannot figure out how that would have caused my photos to disappear.
    Thanks in advance for any assistance.
    Marilyn

    I remember being cautioned to never do anything with the iPhoto Library. Should I have clicked on the iPhoto Library and then Restore?
    I do not know "how" items are being placed in the LaCie external drive, just that it shows a backup running about every hour. I have taken a snapshot of the Time Machine Preferences I would you to see. Maybe that would answer this question.
    In March 2011 I had to have hard drive on my iMac replaced. I had been using a Seagate external drive for backups. However I was not using Time Machine. When the Apple guru was helping me restore all my files etc on the new hard drive he was not familiar with Seagate and recommended I purchase this LaCie and use Time Machine. I never had any problem retrieving items from the Seagate backup. It was very straightforward. As I mentioned previously, I just don't have a clue with the LaCie and Time Machine.
    I hope this is not TMI.
    Marilyn

  • How to retrieve data from inside the folders in SharePoint SSRS

    Hi ,
    How to get the data from inside the folders and subfolders.
    How can I do that.
    https://social.msdn.microsoft.com/Forums/en-US/15451351-4ee2-428c-a0b7-135810e4cbfa/action?threadDisplayName=ssrs-reports-sharepoint-list-datasource-how-to-retrieve-items-from-subfolders
    Here the information is not given.
    Regards
    Vinod

    Hi Vinodaggarwal87,
    According to your description, you want to retrieve data from sharepoint list in a sub folder. Right?
    In this scenario, we should select the XML data source type and in the connection string provide the
    List.asmx service URL when creating data source. Then we need to use the List web Service and specify "recursive" for ViewAttribute in Lists.asmx. For detail steps, please refer to the links below:
    Generate SSRS report on SharePoint List with folders using List Service.
    SSRS: how to specify ViewAttributes when creating a report against a SharePoint's list
    If you want to set the ViewAttribute on CAML query level. You need add the view tag outside of query tag:
    <View Scope="RecursiveAll">
        <Query>
            <Where>...</Where>
        </Query>
    </View>
    Reference:
    View Element (List)
    ViewAttributes Recursive Scope not working SharePoint 2013 CAML Query to fetch all files from document library recursively
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Object corruption when retrieving object from List

    Hi,
    We have a batch program. There are muliple threads running which read data from database and then processes the data.
    In each thread. there is a call to fetch data from a table, create objects and populate a list and return it.
    This list is then given to another method which processes each item from the list
    This is a simplified version of what the code looks like.
    public class Manager{
         public void run(){
              Reader r = new Reader();
              Processor processor = new Processor();
              List list = reader.getItems();
              processor.processItem(list);
    public class Reader{
         public List getItems(){
              List list = new ArrayList();
              // Resultset rs = execute a query and get
    // a resultset object
              while(rs.next()){
                   Item item = new Item();
                   // set information from rs and set
    //into item
                   list.add(item);
              return list;
    public class Processor {
         public processItem(List list){
              Item item = null;
              while (!list.isEmpty()){
                   item = (Item)list.remove(0);
    In the processItem method of Processor class, when I retrieve item from the List
    it should return me an object of type Item. But very rarely what happens is that
    the object I return is not of type Item, but null or a junk class like [C@1309b55.
    Once this happens, i get a class cast exception when i am trying to cast this to
    Item class.
    Can anyone please tell me if you have encountered such a scenario before?
    The process is running in a 2 processor environment.
    It's mulithreaded, but method calls are done from within a thread.
    The ArrayList is not shared across multiple threads. It's life starts
    and ends within the run method of the thread.

    Item class is made up of three instances of three
    separate classes with corresponding getters and
    setters.
    All these 3 classes, have member variables of String,
    int and double.
    There are getter and setter methods for all of the
    variables as well as overridden equals and hashcode
    methodsYou have to show your code, inside [code] and [/code] tags.

  • Retrieving values from a JComboBox - Design question.

    I would like some design guidance on a problem that I am hoping has been solved before. Here is my situation:
    I have a JComboBox that I populate with String values from a database table. The exact set of values to be loaded into the JComboBox varies according values specified elsewhere on the GUI.
    When I select an item from the JComboBox, I need to read the database to retrieve more information. The text is not sufficient for me to identify the data I need, so I need to get the table key from somewhere.
    Is there anyway I can associate my table key with the text value inside the JComboBox and retrieve it when the user selects a drop down value from the JComboBox?
    Many thanks in advance.

    when you load the data from the db, try to get ALL the information needed: item label+item value+description. put this data into a map (a hashmap) for example using a unique identifier. For example, use a numeric index. In this case, the item value should be the index that uniquely identifies your items.
    create a simple bean that encapsulates the item contents: index+value+label, description.
    Doing this will avoid the huge db access occurences.
    hth

  • Is it possible to retrieve deleted items from the Pages App please?

    IIs it possible to retrieve deleted items from the Pages App? Thanks

    From within the Pages app, no. If you have an iTunes or iCloud backup that would have contained the file, and you are backing up Pages, it could be received via a restore using that backup (this would wipe out any newer data however).

  • Retrieving data from database into tabular layout item

    Hi..
    If the number of product_id is 1; I can retrieve data from the database into tabular layout item.However, if the number of product_id is more than 1 error message is shown.
    Here is my code:
    select product_id
    into : PRODUCTS. ID --Tabular layout item
    from products
    where customer_id=5;
    Any suggestions????

    It's simpler to do so:
    insert that code in a post-query trigger at block level (block where is multi-item)
    You will see after execute-query, your item will be populated.
    I wrote post-query trigger no post-quert
    Message was edited by:
    RV

  • I accidentally deleted items from a list in reminders.  how can i retrieve them?

    i accidentally deleted items from a list in reminders.  how can i retreive them from icloud?

    From your backup.

  • Retrieve image from database to non-database item

    Hello
    I need to load in a non database item, a image stored in a long raw field in the database.
    The READ_IMAGE_FILE works fine to read from a file and to save the image in the database, but how I load the image in a block in a non database item?
    Any suggestions???
    Thanks!!!

    Hi, thanks for your comments...
    I need to display in non-db-items because I have a form that dynamically fills an matrix of items from various tables. For example one data is on the table A, another data in table B and image is stored in the table C.
    A process dynamically obtains each data where needed and fill the matrix based in a previous criteria.
    Possibly this management can be adapted so that the image is read into db-items in my form, however I would like to know if there is a simpler way to do that, without having to change my code.
    Thanks!

  • Retrieve item-descriptor name from SKU id ...?

    Hi All,
    i want to retrieve item-descriptor name for the given SKU id..? Could you pls tell..?
    Thanks,
    Vishnu

    Hi,
    With ATG 10, this method is replaced by getItem(String,String). If the second argument, i.e. the descriptor name is unknown, then use getItem(String,getDefaultViewName()).
    So you can use,
    repository.getItem(skuId,repository.getDefaultView()).getItemDescriptor().getItemDescriptorName();
    Hope this helps.
    Thanks,
    Gopinath Ramasamy

Maybe you are looking for