Problem trying to update a table cell

Hello all,
I'm trying to implement a setValueAt method using an arrayList.....no success. Could anyone help?
When trying to change the a value in the table I get these errors:
"Exception occurred during event dispatching:
java.lang.ClassCastException: java.lang.String
at CachingResultSetTableModel.getValueAt(CachingResultSetTableModel.java:37)
at javax.swing.JTable.getValueAt(JTable.java:1711)
at javax.swing.JTable.prepareRenderer(JTable.java:3530)"
public void setValueAt(Object avalue, int r, int c){
if(r < cache.size()){
row[c] = (Object[])cache.set(r, avalue);
fireTableCellUpdated(r, c);
}//setValueAt
*********For reference here's the getValueAt method*************************
public Object getValueAt(int r, int c){
if(r < cache.size()){
row = (Object[])cache.get(r);
return row[c];
else
return null;
}//getValueAt

Hello,
I am new at implementing this a table model and JTable, so all I am working with is the mainApp, the model, and the JTable. I am not too sure if and what listeners I should setup.
I can compile the program. After the data is presented in the table, I try to change a value in one of the cells. Once I have clicked out of the cell I get the ClassCastException: java.lang.String error. I believe the exception is being created by the data I am entering. Do you know of any links that could help me figure how to properly update a cell.
Determen

Similar Messages

  • Im trying to update db table in  user exit, with the internal table

    Im trying to update db table in user exit, with the internal table
    my scenario:
    loop at itekpo.
    updating itekpo -
    > at the end of user exit the db table ekpo have to be updated
    endloop.
    Im updating internal table, using 
    MODIFY itekpo TRANSPORTING INCO1 INCO2  WHERE ebeln = itekpo-ebeln
    where itekpo is internal table, but it is not updating the db table 'ekpo'.
    i also tried updating ekpo directly !
    Thanks in advance

    Hi,
    you can search in the forum itself,
    Try this link for instance
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=tocreateaBADI&adv=false&sortby=cm_rnd_rankvalue
    You can find a code for finding BADI as a report with the following Transaction
    finding badis
    How to find BADIs
    Reward if helpful
    Regards
    Byju

  • HT201210 im always having problems trying to update my ipod touch why

    Im always haing problems trying to update my ipod youch why

    You'll have to tell us how you are trying to update, and what happens when you try.

  • My itunes id is blocked by apple because of an internal problem trying to update the itunes version, apple support is not helping at all and I need to update all my application. Is anybody you had this problem before? and how did they help? thanks

    my itunes id is blocked by apple because of an internal problem trying to update the itunes version, apple support is not helping at all and I need to update all my application. Is anybody you had this problem before? and how did they help? thanks

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Trying to update 2 tables using right join (UPDATE Registrations RIGHT JOIN Registrations2)

    I am trying to update [01-POs] from [01-POs1]
    They both have the same fields and both have a primary field of [PO Number]
    The code below does not work:
    Update [01-POs] right join [01-POs1]
    On Registrations.[01-POs].[PO Number] = [01-POs].[PO Number]
    SET Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID,Registrations.[Name] = Registrations2.[Name]
    REF:  https://social.msdn.microsoft.com/Forums/office/en-US/bea031e1-46cc-41b7-a8de-8c897c52019d/update-registrations-right-join-registrations2?forum=accessdev

    That is the problem, I don't understand this code at all, but I know what I hope it will do.
    I have one table that pulls from an oracle database the way I want it, then uploads to the live database.  At this time I delete all records from the main table, then import all new records (10,000+ each time).  This causes my database to grow
    in size very quickly (I have 7 of these type of tables).  My hope is that this will update the existing records, and append the new ones.  Bonus would be if it will delete the ones that are no longer valid (no longer on the oracle pull).
    [01-POs] is the main table that I want to pull from
    [01-POs1] is the live table, that I want to sync to [01-POs]
    [PO Number] is the key field (not auto number)
    The rest of the fields are all the same and need to be updated
    I hope this explanation helps.
    Note:  Registrations and Registrations2 are from the original code that I didn't know how I should change.

  • PL/SQL Trying to update a table through trigger on the same table

    Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
    The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
    You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
    Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
    And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
    Message was edited by:
    user625855

    CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
    DECLARE
    current_transport_id NUMBER;
    check_value NUMBER;
    check_block_id NUMBER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    current_transport_id := get_curent_trans_id; --function that gets the current transport_id
    check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
    check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
    IF check_value = 1 AND check_block_id = 0 THEN
    create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
    UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
    ELSE
    null;
    END IF;
    END block_id_trigger;
    Ok, I cleaned the code somewhat.
    user625855

  • Timeout problems trying to update to iOS 8.1

    iPhone 6 was updated to iOS 8.1 on the first day of release.  It took more than ten hours (!!) but it completed.
    However I can't complete an update on iPad 3.  Five or six attempts in several days have all gone the same way:  the update starts, asks me to accept the legal stuff, and download begins.  An estimate of time required appears - I've seen estimates from 3 hours to 16 hours - but after 1-3 hours the update aborts, says the server has timed out.
    I have reset and hard-reset (I think*) the device.  I've also tried a Restore through iTunes, same timeout error.  There is more than 15Gb of free space on the device.  Nothing wrong with internet service here... everything else including an experiment with downloading an 11Gb file across the internet has worked fine and as fast as expected.
    Can I do anything to make this process complete?  Mine is a 64Gb WiFi + Cellular, Model A1430 / MD368C/A, already running iOS 8.02.
    Thanks in advance for any advice.
    * Instructions found online for hard-resetting the iPad with the Home and On/Off buttons have appeared to go through the steps but the device still contains all of my apps and data.  Is there a way to factory-reset the device and wipe it clean before trying to update it to 8.1?

    Two more attempts since posting this.  One failed with a 9006 error, so Microsoft Security Essentials was turned off on the PC (never been a problem before).  The next one failed with another server timeout error.
    All 7-8 failed attempts have been with the iPad wired to the iTunes on PC.  About 8-9 Apple devices have been updated this way for years.  Desperate to try anything, I unplugged the iPad and told it to use its wireless connection to update itself.  THE 8.1 UPDATE COMPLETED IN ABOUT 20 MINUTES!
    I've spent HOURS on this!  iPad connected wirelessly to the exact same router and network that it has been plugged into during all previous attempts!  NOTHING on the PC was changed since previous successful updates (including iPhone 6 to 8.1 just a week ago).
    The Apple is losing its shine.

  • Trying to update one table from a second table when data is different

    Hello;
    I have a the same table in two databases. The database are connected with a DB Link. I am trying to update one of the tables based on the data in the second table when the EMP_ID matches but the LAST_NAME does not match.
    The table(s) look like:
    Table Name:EMP
    EMP_ID
    LAST_NAME
    FIRST_NAME
    MIDDLE_INITIAL
    My SQL is:
    update EMP TARGET
        set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = (
            select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL
            from EMP@OTHER_DB SOURCE where
            TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID
            and TARGET.LAST_NAME <> SOURCE.LAST_NAME); This returns an update count of all the rows not the few that I want.
    Any help would be great!

    Hi,
    Sky13 wrote:
    Hello;
    I have a the same table in two databases. The database are connected with a DB Link. I am trying to update one of the tables based on the data in the second table when the EMP_ID matches Do you <b>physician</b>_id?
    but the LAST_NAME does not match.
    The table(s) look like:
    Table Name:EMP
    EMP_ID
    LAST_NAME
    FIRST_NAME
    MIDDLE_INITIAL
    My SQL is:
    update EMP TARGET
    set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = (
    select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL
    from EMP@OTHER_DB SOURCE where
    TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID
    and TARGET.LAST_NAME <> SOURCE.LAST_NAME); This returns an update count of all the rows not the few that I want.
    Any help would be great!There's no WHERE clause in that UPDATE statement, so every row of the target table will be modified.
    if you only want to modify the rows that have a match in the source table, then add a WHERE clause (perhaps "WHERE EXISTS (...) with a sub-query very miuch like the one you already have), or use MERGE instead of UPDATE.
    If you'd like help, post CREATE TABLE and INSERT statements to re-create the tables as they exist before the UPDATE, and also post the contents of the changed table after the UPDATE.
    Always say which version of Oracle you're using.
    Perhaps you want something like this:
    {code}
    MERGE INTO     emp     target
    USING     (
         SELECT     o.emp_id
              ,     o.last_name
              ,      o.last_name
              ,      o.middle_initial
              FROM     emp@other_db     o
              JOIN     emp          t ON     o.emp_id     = t.emp_id
                             AND     o.last_name     != t.last_name
         )          source
    ON     (target.emp_id     = source.emp_id
    WHEN MATCHED THEN UPDATE
    SET     target.last_name     = source.last_name
    ,     target.first_name     = source.first_name
    ,     target.middle_initial     = source.middle_initial
    {code}
    assuming emp is unique, at least in other_db.
    This will work in Oracle 10 (and up). In Oracle 9, MERGE always requires a WHEN MATCHED clause, so add one if you must. it doesn't matter what it does; the USING subquery will only return matches.
    Edited by: Frank Kulash on Oct 10, 2011 4:45 PM

  • Problem trying to update with yaourt

    Im trying to update the package chromium-browser-bin doing:
    yaourt -Suy --aur
    When yaourt detects the new version, it asks me to update, so far, so well...
    Suddenly htis message appears:
    ==> Edit the PKGBUILD (highly recommended for security reasons) ? [Y/n]("A" to abort)
    ==> ----------------------------------------------
    ==>n
    Wathever i reply, whatever i do, i allways get throwed back to the shell, no update done.............. is there a way to fix this?
    Thanks!

    you should check out packer or bauerbill, yaourt isn't maintained and there are a lot of problems with it

  • Problem with images inside of table cells

    I've run into a problem on this web page:
    http://www.solidrocknet.org/index2.html
    The the background of the table cells which contain an image
    is showing
    through in the form of a strip at the bottom of the cell. You
    can see
    this as a black strip in the cells which contain the logo
    graphic,
    centerpiece photo, and the photo strip and as a blue strip
    under the 4
    separate photos on the bottom.
    These problems are appearing in Firefox. It almost looks
    correct in
    IE6/7 except that the blue strip appears under the bottom
    photos.
    Can anyone see what I am doing wrong?

    The best practice is to include -
    a img { border:none; }
    in your CSS so that any image inside an anchor tag is
    prevented from having
    the border.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "K0rrupt" <[email protected]> wrote in
    message
    news:f5i5fc$bhp$[email protected]..
    > sometimes browsers like to display a blue lines around
    pictures. So as
    > good practice you should add it.
    >

  • S4 Problems Trying to Update 4.3

    My phone starts out fully charged but within 2 hours the battery completely dies. I never have wifi, mobile data, GPS, screen pause, or any other features on and I always close my applications, clear the task manager, and the cache. This problem persists every day. The phone also gets very hot, but it is not in the sun or anything. I have tried the update since Monday, but my phone resets and the screen turns black, the blue notification light turns on, and the two touch sensitive buttons light up but do not work. I have to take the battery out to turn my phone on again. The screen also freezes at times and again I have to take the battery out. When I simply try to restart my phone, the same thing with the blue light and touch sensitive keys happens. I also can not send or receive texts half the time, even when I have full service. My wifi has started to lag as well. Though the software update continues to fail, at times it says 100% updated then it says software update failed. It does not seem to be going through, whether I do it over wifi or mobile data. This is causing me a lot of inconvenience as I can not communicate through text easily and I am constantly having to take the battery out and put it back in. I am thinking the only option right now is a factory reset which I am trying to avoid. The phone is only a few months old and it has not been dropped in or on anything.

    You would not want to install a major update onto a phone with so many problems, it would just compound the issues.
    The very best way to install an update is by doing a factory reset prior to the update download then also after the install. This will eliminate any potential problems of conflicting software already installed by you previously.  I know a lot of people here do not bother with factory resets prior to updating because it is a lot of work reconfiguring your phone and some have been sucusseful not doing so, but the majority have not, hence all of these S4 problem threads. I have not installed this update first, as I always wait a few weeks to see what problems people have after they update, and there is a ton of it.  If I do decide to update it will be from a factory reset phone.

  • Problem Trying to Update

    I have a iPhone 4 on 4.2.6.  Tried to update to 5.0.1.  On iTunes 10.5.1.  Download wouldn't start originally so I downloaded manually from Apple website and tried to update.  I got as far as "Initializing iPhone for Update" is what I think the bar said.  After 10 or 15 minutes I got an error.  The phone is now stuck in recovery (the symbol telling me to plug in to iTunes).  I can hold the power button to shut it off.  Turn it back on; Apple logo and then recovery again.  iTunes won't recognize the phone at all.  But, my PC does make the "bong" noise when I plug/unplug the phone.  What gives?  Did 5.0.1 brick my phone?

    Use the steps in this support document to put your phone into recovery mode:
    http://support.apple.com/kb/ht1808

  • Problem trying to update new version of software!

    I am trying to update to the 4.1 software and it keeps telling me "There are purchased items on the iPhone .....that have not been transferred to your iTunes library....transfer before updating."
    I have gone to Transfer Purchases from iPhone numerous times but it still doesnt work. Any ideas?

    I solved it.
    I, originally, download and installed the software under the Mac App Store when I was using OS X Mavericks.
    I was getting all sorts of error messages from the Mac App Store under Snow Leopard.
    I simply copied that version to my working OS X Snow Leopard disc and it is working fine, now.
    Thank goodness for having multiple backups on three drives!
    Whoo! Spent a good chunk of the day trying to figure this one out!

  • Hello all trying to update a table with utl input file

    Hi all
    please kindly help me with the below :
    i have a table having 100 rows ,where i have to update the vxxx_DESC column from teh input file ,when the xxx_CODE is equal to vxxx_CODE from teh input file which is 3 didgit numeric format like the below :
    exmp csv nput fie: where i have some duplicate records in it.
    238,FKP
    208,DKK
    242,FJD
    978,EUR
    978,EUR
    978,EUR
    953,XPF
    978,EUR
    950,XAF
    from the below script, in the log file its writing for me like -
    Total Records present in Input file : 275
    Total Records updated sucessfully in table : 186
    But the update count is wrong whihc is more than the existing records. how do i get the exact update count avoiding the duplicates from the input file.
    Please kindly help.
    DECLARE
    finfile UTL_FILE.file_type;
    flogfile UTL_FILE.file_type;
    vglobal_name VARCHAR2 (300) := NULL;
    vlogfile_PATH VARCHAR2 (500) := NULL;
    vINFILE_PATH VARCHAR2(100) := NULL;
    vinfile_name VARCHAR2 (400) := 'INPUTFILE.csv';
    vlogfile_name VARCHAR2 (500) := 'INPUTFILE.log';
    vxxx_CODE CUN_CODE.xxx_CODE%TYPE :=NULL;
    vxxx_DESC CUN_CODE.xxx_DESC%TYPE :=NULL;
    vinput_rec VARCHAR2 (500) := NULL;
    ntotal_rec NUMBER (20) := 0;
    nUPD_rec NUMBER (20) := 0;
    BEGIN
    DBMS_OUTPUT.ENABLE (50000);
    IF INSTR(vGlobal_name,'RAMAN') > 0
    THEN
    vLOGFILE_PATH := '/home/log/';
    vINFILE_PATH := '/home/rpts/';
    ELSE
    DBMS_OUTPUT.PUT_LINE('Incorrect DB instance, so exiting from: ' || vGlobal_name);
    RETURN;
    END IF;
    BEGIN
    flogfile := UTL_FILE.fopen (vlogfile_PATH, vlogfile_name, 'W');
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ( 'ERROR WHILE OPENENING LOG FILE : '
    || SUBSTR (SQLERRM, 1, 200)
    END;
    BEGIN
    finfile := UTL_FILE.fopen (vINFILE_PATH ,vinfile_name, 'R');
    LOOP
    vxxx_CODE :=null;
    vxxx_DESC :=null;
    BEGIN
    UTL_FILE.get_line (finfile, vinput_rec);
    vinput_rec:=TRIM(vinput_rec);
    ntotal_rec := ntotal_rec + 1;
    vxxx_CODE := SUBSTR(vinput_rec,1,INSTR(vinput_rec,',',1,1)-1);
    vxxx_DESC := SUBSTR(vinput_rec, INSTR(vinput_rec,',',1,1)+1);
    BEGIN
    UPDATE CUN_CODE
    SET xxx_CODE= vxxx_CODE
    WHERE xxx_DESC= vxxx_DESC ;
    nUPD_rec := nUPD_rec+SQL%ROWCOUNT;
    EXCEPTION
    WHEN OTHERS
    THEN
    UTL_FILE.put_line
    (flogfile,
    'ERROR FOR WHILE UPDATING : '
    || vxxx_CODE
    || SUBSTR (SQLERRM, 1, 250)
    END;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    UTL_FILE.put_line
    (flogfile,
    'No more records in the input file.So Exiting the update :'
    EXIT;
    WHEN OTHERS
    THEN
    UTL_FILE.put_line
    (flogfile,
    'ERROR WHILE READING FROM INFILE. '
    || SUBSTR (SQLERRM, 1, 250)
    EXIT;
    END;
    END LOOP;
    UTL_FILE.put_line (flogfile,
    'Total Records present in Input file : ' || ntotal_rec
    UTL_FILE.put_line (flogfile,
    'Total Records updated sucessfully in table : ' || nUPD_rec
    DBMS_OUTPUT.PUT_LINE('Total Records updated in table : ' || nUPD_rec);
    DBMS_OUTPUT.PUT_LINE('Total Records present in Input file : ' || ntotal_rec);
    EXCEPTION
    WHEN OTHERS
    THEN
    UTL_FILE.put_line (flogfile,
    'ERROR WHILE OPENING INFILE '
    || vinfile_name
    END;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ( 'ERROR WHILE GETTING GLOBAL NAME'
    || SUBSTR (SQLERRM, 1, 250)
    END;
    <<skip_loop>>
    IF UTL_FILE.is_open (finfile)
    THEN
    UTL_FILE.fclose (finfile);
    END IF;
    IF UTL_FILE.is_open (flogfile)
    THEN
    UTL_FILE.fclose (flogfile);
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ( 'ERROR WHILE ACCESSING DB '
    || SUBSTR (SQLERRM, 1, 250)
    END;
    /

    975482 wrote:
    i have a table having 100 rows ,where i have to update the vxxx_DESC column from teh input file ,when the xxx_CODE is equal to vxxx_CODE from teh input file which is 3 didgit numeric format Looks like your code does exactly the opposite :
    UPDATE CUN_CODE
    SET xxx_CODE= vxxx_CODE
    WHERE xxx_DESC= vxxx_DESC ;Additional suggestions :
    1) create a directory object pointing to the location of your input file
    2) create an external table to read the file
    3) use a single UPDATE or MERGE statement to do the job, instead of this mess

  • Problem trying to update to iPhone OS 3.1.3 and issues with paid apps

    Hi,
    I bought my iPhone 3GS when my old dumbphone died and have thouroughly enjoyed the experience. I've been having a couple of minor issues which I've been wondering about of late:
    1) I know the 3.1.3 update came out some time ago, but I sync my iPhone and it won't ever update. I tried to manually do it (i.e. pressing the button that says "Check for update" in iTunes->iPhone but it just says "3.1.2 is current". At first I thought it was something to do with the apps because around the time the update came out an error message appeared when I synced that said something about the apps not being able to be installed. I was perplexed because my iPhone had all its apps working, so I thought maybe that's why it won't update and clicked on "More Information". I followed the instructions to save all the apps in my computer, then deauthorize and reauthorize my computer and sync my iPhone. This solved the error message issue, but it still won't update. So, is it something with where I live (Puerto Rico)? I want the update, but I just can't get it.
    2) Whenever I try to buy an app whether it's thru the app store on the iPhone or on iTunes, I can't because apparently it won't let me use my debit card. It's a Visa debit card and I have used it for all my internet purchases over the last year and it's always worked. I contacted a support person at Apple but all they could tell me was that the bank was for some reason not allowing them to access the funds, and that I should just buy a gift card and use that. Anybody else have this kind of problem?
    Thanks!

    Well? Does anyone know what I can do to upgrade to 3.1.3???

Maybe you are looking for

  • Missing images in the Dreamweaver UI! How did that happen?

    I tried reinstalling the app, and there are still missing images in the UI...

  • Client no longer visible in Remote Desktop

    For years I've controlled my Mac Mini from my MacBook over my home Wifi, but all of a sudden it's stopped working. The client (Mac Mini) is no longer visible in "Scanner", and will not connect via IP address 192.168.0.3 I've confirmed both computers

  • NCS - Wired clients not showing ip address

    I have Cisco switches reporting to NCS, I see mac addresses but no ip addresses.  I do not see any where to add a core router or arp table polling.  Has anybody got ip addresses to report on the wired side?

  • Task Deadlines- Create deadlines for a task

    There is a feature that is present in both MS Project and PWA 2013 that is  Task Deadlines Create deadlines for a task so anyone can please tell me how to create deadlines for task from PWA in project server 2013.

  • Audio across multiple slides

    How do I get a song to continue to play across multiple slides but not during the whole presentation? For example, I want a song to start on slide #6 and stop at slide #12.