How can I get the edited value from the editor in JTable

I have a JTextField added as an editor to a cell in JTable.
I value gets changed when I press enter.
but in actionPerformed of the JTextField when I say
String txtEditorValue = txtEditor.getText();
I am getting the old value. How can I get the edited value? Thanks.

Hi,
I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
Object obj = jt.getModel().getValueAt(row,column);
if you know, that there is a String in this cell use
String str = (String) jt.getModel().getValueAt(row,column);
The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
greetings Marsian

Similar Messages

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can i get HD video out from the lumia 900. ? ...

    How can i get HD video out from the lumia 900. ? Is there some kind of gable. ? N8 has HD cable port..so where is lumia`s port. ?

    Download Zune and start it, when started connect your Lumia 900 and you can now transfer mediafiles from the Lumia to your PC through a USB connection. For Mac use the Mac connector.
    Press the 'Accept As Solution' icon if I have solved your problem, click on the Star Icon below if my advice has helped you!

  • HT204411 How can I get a tv show from the Canadian iTunes store from the United States Store?

    I have been trying to find the tv show the Listener and a few others everywhere. I can only find them in the Canadian iTunes Store. How can I get it in the United States Store?

    Ask whomever makes the show to sell it in the U.S Store.

  • How can I read an ID-value from the LMS and insert this into an URL?

    Hi
    Right now I am struggling with a little problem. Hopefully anyone here knows the answer. For the latest course I am building (Captivate 6), it is necessary that at one point the course reads an ID-value from the LMS. After that, this ID should be inserted into an URL.
    To be more precisely: the ID must be read (getValue) from cmi.archive_id and inserted into an URL like that: http://.../archive.php?action=pdf&objectID=ARCHIVE_ID.
    Unfortunately I am more of a designer und less of a javascript-maestro (well...I am a javascript-noob to be precisely), therefore I am pretty clueless how to do that. I tried a simple executed action (run Javascript: cpEIGetValue('cmi.archive_id'); and after that open URL http://.../archive.php?action=pdf&objectID=ARCHIVE_ID), but...well...that didn't work.
    Any ideas?
    Thanks a lot in advance

    Think you'll find help looking at Jim Leichliter's website:
    http://captivatedev.com/
    He has great tutorials about JavaScript and also a widget that allows to enter a variable in URL's
    Lilybiri

  • How can I get some specific value from AP

    Hello,
    I have AP 350 or 1100 and management software CISCO WORKS for WINDOWS. I need for our customer information how he can get some SNMP specific information OID like signalstrange or something another specific OID. We can get traps from AP but it's not what we can.
    Do you know somebody any helps?
    Thank you
    David

    For Windows
    Download MG-SOFT Corporation's MIB-Browser, its evlauation version.
    Download the AP MIBs from Cisco.
    Compile the MIBs using the MG-SOFTs MIB-Explorer and then you see the OID values and expalnations.

  • HT201269 All the photographs stored on my computer ended up getting put on my iPhone. How can I get rid of them from the iPhone?

    All the photographs stored on my computer ended up getting put on my iPhone. How can I remove them from the iPhone?

    Photos synced to your phone can only be removed from your phone the same way they got there, through the iTunes sync process. Connect your phone, iTunes running, & under the photos tab remove the checks for all albums/folders you do not want on your phone. Hit the apply/sync button & they will be removed from your phone.

  • How can I get selection screen values from outside of program?

    Hi. all.
    Now. I'm developing moritoring systems and I have problems. for getting selection screen values in runtime. Is there any function, methods or structure to know this?
    I'd like to get selection screen values while several programs working in runtime and update these values to table to show current system's status and input values for users in real time.
    For example.
    Now. 3 PGMs are working on systems.
    each PGM is ZAAA01, ZAAA02, ZAAA03.
    and ZAAA01 needs input parameter P01, ZAAA02 needs input parameter P02, ZAAA03 needs input parameter P03.
    In this case, I have to know values of P01, P02 and P03.
    The mornitoring systems will show current working status of PGMs(ZAAA01~03)' and these PGMs' input values.
    As fas as I know, the structure 'SCREEN' can be used in each PGM for runtime. Is there any SAP system structure or something else for this purpose?
    I hope your hopeful repsponse.
    Thanks.

    Umm..I need to explain more about this.
    of course I know  SET, GET PARAMETERS.
    But I'd like to minimize coding for each PGM level.
    I have over hundreds PGMs and I have to develop the PGM(including tables and structures) that mornitor
    all of those PGMs on a report in real-time.
    This PGM is kind of  Process Manager.
    First I should know dialogue job PGM and background job that pass parameters using SAP(ABAP) Memory.
    And then I have to update those PGMs' input values via screens into tables in real-time.
    So, I couldn't use SET,GET PARAMETERS for this PGM.
    I want to know methods that can be used for getting information about runtime PGMs' selection screen field values in SAP systems wide.
    Please help me some one knows this.

  • How can i get a particular model from the iphone 5s

    I am from austria an for the lte i need the iphone 5s model A1457 or A1530. If i would buy one, would i get one of the model?
    Thanks for answering. ;)
    ...and sorry for my english

    If you live in Austria you cannot purchase from an online Store in another country
    The various models are only available in the countries shown on table I linked for you
    You could purchase in Germany and you will get the same warranty cover in Austria since both are member states of EU

  • If messages are deleted from an itouch that is synced the same Apple ID and phone number, how can you get them to delete from the phone as well?

    how do I delete messages from both my itouch and my iphone

    You have to delete the messages from the individual device. If you delete messages on one device, messages on the other are not automatically deleted.

  • I need to set up a new iTunes account. How can I get all my music from the old account on to the new one??? Thanks../

    I have just bought an ipad 2 and wish to set up a new account as now I won't have to share with my sister. I want to get all the music off my current iTunes account &amp; put it on to the ipad/new iTunes account. I'm not too sure how to do this though.... Please help lol :-) x

    If you mean iTunes libraries or computer user accounts, just create one. To make a new iTunes library on Windows, launch iTunes with the Shift key held down and choose Create Library.
    If you mean iTunes Store accounts, click here and request assistance.
    (79934)

  • How can I get back my bookmarks from the old sync?

    I reinstalled Firefox 29.0 but when I try to download the old sync bookmarks I can't find a way to enter my sync key.

    See this KB article - [[How to update to the new Firefox Sync]]

  • How can I get specific files back from my Time Machine backup?

    I wanted to make a fresh install on my MacBook Pro, in order to only have Java 8 instead of any older Java versions. So far so good. But now I want to get specific files/libraries from my external backup (USB):
    One Parallels Virtual Machine
    My old mail
    My iPhoto Library
    I don't need any settings for these, since I can easily configure them again.
    I already used the Migration Assistent to restore all apps.
    How can I get specific data back from the backup without restoring all stuff that I don't want anymore?
    I'm now working on a new account on the fresh system, called 'Admin'. My old account was called 'Hans' (or 'hans') and I'd like to create such an account again for all my tasks.
    Hans

    How can I get specific data back from the backup without restoring all stuff that I don't want anymore?
    I'm now working on a new account on the fresh system, called 'Admin'. My old account was called 'Hans' (or 'hans') and I'd like to create such an account again for all my tasks.
    You will want to add the same User account(s) which hold the data you want to restore. So you will want to add a User account of 'Hans or hans'. Check your Time Machine back up drive to see how the User account is labeled (Hans or hans). Navigate to the Users folder and see how it's labeled.
    You can then use your Time Machine back up drive and navigate to the User Home folder to copy its data over (e.g. contents from Documents, Downloads, Music, Pictures, etc.). Repeat for other Users.

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can I get the edited pictures from the thumbnails to full size?

    I upgraded to iPhoto 11, the thumbnail photos show my previous edits, but when I click on the photo to make it bigger, it reverts back to the unedited, original picture.  How can I get the edited pictures from the thumbnails to full size?

    Verify you are using iPhoto11 ver 9.5
    if not run the >Software update or check your apps folder and make sure the correct iPhoto is launched,  not an older ver.

Maybe you are looking for

  • In table PAYR field CHECV is not being populated when void check is reissue

    Hello,  we are trying to find a link between original check # that is voided and then new check # is issued when the reopened invoice is repaid.  It is very cumbersome trying to research back to original check # as there is not link in any SAP tables

  • Problem in running entity bean examples

    I am trying to run a entity bean example in my bea ,earlier i was getting the error that the data source name could not be found ,and so i replaced the data source name in my .xml file as cgDataSource and now i am not finding that error ,and the jsp

  • Checkered boxes

    The flash player is showing a white and gray checker board where an image should be. I have tried uninstalling and reinstalling flash player as well as updating my browser. Flash is not working in either Firefox OR IE! I have tried a few online searc

  • Viewing dvd on wide screen

    i created a movie in imovie. then i shared it to idvd and created a dvd. no matter if i do it in 16;9 or 4:3 when i watch it on most tv screens, parts of it are cut off at the top. is there any way to avoid this?which is my betst choice 4:3 or 16:9?

  • Keyboard malfunction and being ignored

    ive had my blackbery 9300 curve just over a year and in that time i have had to get it replaced 5 times,which is just unexceptable.Recentley it has started playing up again by everytime i press the letter "n" and "m" and the space bar it types nmnmnn