JTable does not update after fireTableDataChaged

Hi everybody,
I have a strange problem here and I don't know how to solve it. In my applet I use a JTable which displays data from a database and uses a customized table model. The JTable has 2 columns and is NOT editable, i.e. you should not be able to change the values directly in the table itself. Instead, a JDialog is opening when somebody makes a doubleclick on a row of the JTable. In this JDialog one can change the data of the selected row and afterwards the JTable and the database should be updated. The database gets updated but not the JTable, although I called myTableModel.fireTableDataChanged()
When I close (dispose) the screen which contains the JTable and then recreate the screen with the JTable (using new MyScreen(....)), then the changes are displayed in JTable (because the table model requeries the database). But when I update the database AND the table model of JTable (via setValueAt) then the changed row is displayed 3 times instead of just 1 time!
Do I have to update both, the database and the table model or is it enough to update the database and call myTableModel.fireTableDataChanged() ?
But as said in the first case the changed row is displayed 3 times and in the second case the changes are displayed not at all. Do you know a solution?
I attach some code snippets.
Your help is appreciated very much!
//should update the table model of JTable
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
row = (Vector) data.elementAt(rowIndex);
row.add(columnIndex, aValue);
data.add(rowIndex,row);
//should update the JTable and the database
if((oldRecipeName.equals(recipeName)) && (oldDesigner.equals(designer)))
//no data-saving necessary
currentDialog.dispose();
else
//save and close
tableModel.setValueAt(recipeName,selectedRow,0);
tableModel.setValueAt(designer,selectedRow,1);
updateRecipe(); //this is a method which updates the database
tableModel.fireTableDataChanged();
currentDialog.dispose();

dear, dear, dear !
in the setValueAt() method, u r adding a new line everytime to the vector. u should not add the data, u should replace the data. change the setValueAt() method to
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
row = (Vector) data.elementAt(rowIndex);
row.setElementAt(columnIndex, aValue);
//data.add(rowIndex,row); don't need to call this. Changes would be reflected in data also.
ta,

Similar Messages

  • Chart does not update after table changes

    Simple X-Y chart using a data series from a table. The chart will not update after changing the table, for example after applying a filter. The chart will update if you close and reopen the file or go to Select Data on the chart.  I use named ranges
    because you can't use table nomenclature directly in the chart series definition.

    Seems to update for me OK. You need to apply the entire unfiltered range to the chart before filtering. Did you do this or filter first and only apply the visible range?
    If not the answer to you query then maybe I am not understanding the problem correctly so can you upload an example workbook?
    Guidelines to post a workbook on OneDrive
    Zip your workbooks. I prefer that you do not just save to OneDrive. (To Zip a file, in Windows Explorer  Right click on the selected file and select Send to -> Compressed (zipped) folder.)
    Go to this link.  https://onedrive.live.com
    Use the same login Id and Password that you use for this forum.
    Select Upload in the blue bar across the top and browse to the zipped folder to be uploaded and select Open (or just double click). (Be patient and give it time to display the file after initially seeing the popup indicating it is done.)
    Right click the file on OneDrive and select Share.
    Do NOT fill in the form; "Select Get a Link" on the left side.
    Click the button "Create a Link"
    Click in the box where the link is created and it will highlight.
    Copy the link and paste into your reply on this forum.
    Regards, OssieMac

  • Outlook 2010 SP1 Profile Does Not Update After Moving Mailbox Between Exchange 2010 SP2 Sites

    I am working on a large mailbox migration from one AD site to another. 
    Exchange version at both sites:Exchange 2010 SP2
    Two Mailbox Servers: MBX01 in site A / MBX02 in site B
    (There is a DAG but keeping this simple)
    Two CAS Arrays: CASA.domain.com / CASB.domain.com
    The RPCClientAccessServer property is set accordingly.  Where MBX01 is set to CASA.domain.com and MBX02 is set to CASB.domain.com
    Clients:Outlook 2010 SP1
    Scenario: I successfully move a mailbox from Site A to Site B.  The Outlook client does not automatically update its server settings to point to the new cas array (CASB.domain.com) and continues to connect to the old CAS server (CASA.domain.com).
    I have seen a few articles regarding this pointing to workarounds such as:
    - repairing the outlook profile on the client
    - delete the existing outlook profile
    - run a script to update the prf file (re-cache's email at the client)
    I am interested in knowing if anyone else has experienced this, what their solution was for a large migration and if any roll-ups or service packs have possibly fixed this problem.
    I would also like to know if you have seen this affect ActiveSync devices.  I am getting mixed results in my tests and thought it may be contributed toward different device types, mobile os versions, etc...
    I have posted this to the Exchange 2010 forum as well, just wasn't sure where to start.
    Thanks.
    Mike

    Hi,
    Seems you got several replies in the thread below that you posted in Exchange forum:
    http://social.technet.microsoft.com/Forums/exchange/en-US/68ae67c1-59f5-44bb-aadc-0aea3f72ad2d/outlook-profile-not-updated-to-new-cas-array-after-mailbox-move-between-sites?forum=exchange2010#68ae67c1-59f5-44bb-aadc-0aea3f72ad2d
    Please come back to the thread above and check if the replies are helpful.
    Since this issue is more related to Exchange, we can provide rarely assistance on this problem. If you need any help on Outlook client side, please don't hesitate to let me know.
    I would appreciate it if you could post the solution here when you found it, so that other community members who have same question in this forum will benefit from it.
    Best Regards,
    Steve Fan
    TechNet Community Support

  • Firefox 15 UI does not update after wake from sleep

    On my Netbook running Windows XP 32-bit, if I leave Firefox open when I put the computer to sleep (by closing its lid), then when I wake it up from sleep, the user interface elements (like the tab bar) won't respond to mouse clicks. This does not happen 100% of the time; in particular it won't happen for a freshly restarted Firefox that is put to sleep, making the problem rather annoying to reproduce. As far as I can tell, I might have to visit some set of websites with Javascript or Flash or something.
    Here are some more details about the user interface, because it is not as simple as non-responsiveness. When I wake it up, when I click on a tab to switch to it, the Windows title bar actually changes to display that tab's page title, but nothing else in the UI updates including the URL bar and the actual page displayed. Similarly for closing a tab; the tab remains, but the title bar shows the title of the tab that would receive focus next. After I "pseudo" close a tab and then restart Firefox, it does not remember that I closed the tab (I save sessions) and restarts with the same set of tabs before I tried to close one.
    I get the problem even after disabling all extensions and resetting all toolbars to defaults. I have not tried to create a new profile because I have a lot invested in my current profile.

    I am going to respond to my self and say I am nuts.
    Canon does not seem to have any uninstaller for this scanner on their site:
    http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&tabact=DownloadDet ailTabAct&fcategoryid=351&modelid=17104
    Which is rather odd since they have installers. this is different from most of their other older scanners. But if you just plugged in our scanner and things worked in OSX, which it should have, then you should be OK.
    However I can confirm that others see this issue (like my dad) and here is the official Canon response to the issue:
    +Dear XXXX:+
    +In some cases, coming out of sleep mode may not properly reinitialize+
    +the USB bus on Macintosh Operating Systems. Unfortunately, the only+
    +work around when this happens is to restart the computer.+
    Of course this in not exactly true as logging out and back in fixes it.

  • Hi I have subvi in subpanel does not update after opening

    Hi I have a problem with subvi updating inside the subpanel, after opening.
    I need  your advice, I am using  LabView 7.1.
    I am asking  for your opinion before I can post my code  because it is very large and made of many files outside the folder.
    Here's the description of my problem.
    - In the main vi, it has an event structure to open 3 references of the files, based on the ring control, Not only that, it also has events for many controls.
    - In each subvi, it also has an event structure ofr it's own controls to work inside
    - After opening the subvi in the subpanel, the controls like strings, are not updated, till the main vi is minimised and maximised again. Then the controls are updated. Weird... But then other controls are unresponsive and in the end I aborted it.
    Funny thing is that, when I stripped most of the parts, leaving the essential ones I wanted to focus and debug.
    It seems working and no problem.
    How am I going to troubleshoot? I don't have any faintest idea as to how to find the cause of trouble?
    Clement

    astroboy wrote:
    Funny thing is that, when I stripped most of the parts, leaving the essential ones I wanted to focus and debug.
    It seems working and no problem.
    The only think i can think of, strip the parts one by one ... when it works, probably you will have find the prolem (the last stripped).

  • Firefox does not update after downloading updates on restart. How to fix?

    For quite some time now I receive the auto-notification that an update is ready to download. I proceed with the download and restart Firefox, yet the browser never updates. How do I fix this short of doing manual downloads every time?
    MacBook Pro Mac OS 10.6 FF v 10.0

    Thanks for your reply, Matt. I already read the knowledge base article, and it doesn't specifically address my issue. The update IS being downloaded, yet it is not updating the FF app - even on restart. As I indicated in my initial question, I've been experiencing this for the last year. To finally upgrade to v.10.0 I had to download a fresh copy of FF. Now, again, for the last two updates that I've been notified on - 10.1 and 10.2 I've followed the same procedure - allowed the downloads, did the restart and NO UPDATE to the app.

  • Windows disc does not update after resizing boot camp partition

    When I bought my iMac, it came with a 500 GB HDD. I used bootcamp to make a 200GB windows partition and a 300GB Mac partition. The other day I bought a 250GB SSD, and moved everything from my 300GB Mac partition onto the SSD.
    My plan was to use the whole 500GB HDD for windows. So, I deleted the 300GB Mac partition and made it free space on the drive. I then expanded the boot camp partition to take up the whole drive using Mini Tool on windows 7.
    Now, windows 7 shows that my drive is 465GB, but when I boot into mac, the bootcamp hard drive still reads 200GB and 300GB are "free space" even though I expanded the drive using Mini Tool.
    I tried to fix this by filling up the hard drive with an extra 120 GB so it exceeded the 200GB limit that windows shows. But when I booted back into OSX to see if it had worked, none of the files were showing up in the drive, making me believe that boot camp and OS X are not reading changes I am making to the bootcamp drive when I use Windows.
    How can I change this so Disk Utility shows the full size of the disc, like Mini Tool does?
    I will try to upload screenshots soon.

    Re-sizing Windows partitions is not supported on Bootcamp. It requires a clean install. The other option is using Winclone.
    Boot Camp 5.1: Frequently asked questions
    How can a Windows partition be resized after Windows is installed?
    You need to delete the Windows partition using the Boot Camp Assistant, and start over to change the size of the Windows partition. Back up your important Windows files first.

  • Help: Multi-SCO Project - Module does not update after reupload.

    hi, I created 4 courses in captivate 4 and repackaged them using the multi-sco projezct function in captivate 4. I uploaded the zip file on our LMS and then the developer went ahead to select assemble courses from lms to add two quizzes (not created with captivate) to make another course. Developer selects from a list of courses including ones from the multi-sco project. However when i went to update the Multi-sco files (since they were in capt 4 and now i update it with captivate 5 version), only 3 of the files are updating, one of the modules refuses to update itself. However, when i looked at the multi-sco project i uploaded on the lms it is updated all four courses, but in the new assembled course one of the modules refuses to update. I have tried updating all the files on the lms with the same name as tha particular course but it still doesnt work.
    Does anyone have any idea what is going on. And how i can fix it?

    yep same problem here
    i had this problem and got a replacement handset.
    i have had to do an update and got the same issue yet again.
    The funny thing is, is when i got my new handset i had to run the email setup application and it worked fine.
    now its failed and i have to boot in safe mode and wipe etc.
    Will someone sort this out???!! O2, Blackberry whoever. Shambles!

  • Mini-image does not update after photo is edited

    Hi, my problem is that I have all my photos on iPhoto 9, but edit them in Photoshop Elements. Once I complete the editing, I save the photo back into iPhoto. What happens is strange - when I click on the edited photo in iPhoto to expand it to full-size, the full-size version shows up with the edits, but no matter what I do, the small version of the photo (i.e. how every photo appears in each Event before being clicked on) still shows the unedited version!
    Is there a way to have iPhoto show the edited version of the photo in the small "icon" size (other than by deleting the photo entirely and re-importing it into iPhoto as a new photo?)
    Grateful for any assistance!
    Would also love any application that made working with Photoshop and iPhoto easier

    Welcome to the Apple Discussions. Here's how to use PSE from within iPhoto so that iPhoto knows that the photo has been edited and updates the thumbnail:
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements 6 the Saving File preferences should be configured: "On First Save: Save Over Current File". Also I suggest the Maximize PSD File Compatabilty be set to Always.
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    OT

  • Card slot does not work after update (14/10/2011)

    Card slot does not work after yesterday update (14/10/2011)! It works with my SD card month ago, but now it dosn't!!!
    MacBook Pro 13 OS ver. 10.6.8

    Thanks for your suggestion. I downloaded OnyX and ran the cleaning function. After restarting, I opened Help and once again the first screen appeared fine. But again most of the links did not work, though those under the "What's New" heading did work. I might add that I had previously tried a variety of suggestions posted in another thread, which included deleting from the caches folder in Home>Library several files such as com.apple.helpui and help.plist in the Preferences folder. (As noted in my previous post this evening, I also created another user but that also did not have any effect.) Any other ideas? Thanks

  • Itunes does not work after Update any more

    Itunes does not start after the uodate and cannot be reinstalled.
    Seems not only a problem to me
    Any solutions yet ?

    Hello Wizzie71,
    It sounds like you updated iTunes and now it will not open. Try the steps outlined in the following article. You may need to re install iTunes but your library will remain intact if you do.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/ht1923
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • HT1688 My Hot Spot does not work after update to 6.0.1.  Service is with ATT.  Apple says problem is with ATT, ATT says problem is with Apple.  Anyone else having this problem?

    My Hot Spot does not work after update to 6.0.1.  Any suggestions?

    Ok, I had the same issue, my phone is unlocked(iphone 5 with 6.1.3). So I went to the apple store and had it replaced. it worked good for a day and started doing the same thing. When the apple tech replaced my phone, he transfered my screen protector to the new one.
    so I thought it was my sim card, I put in my sisters sim card from a different carrier and it did the same, so then I was like let me take off the screen protector, and that was it.
    so guys, if you have a screen protector on your phone and it's doing "low signal", "No Service", "Searching", "Full bars cycle" then take off the screen protector. so far my phone is working normal.

  • Click to activate does not work after update

    Click to activate plugin does not work after updating to version 23.0.1

    hello Kamullia, if you have set click-to-play to true in about:config you can now go to the ''addons-manager > plugins'' section and set the permissions individually for each plugin type.

  • WiFi iPhone 4S does not work after update iOS 6.0

    WiFi iPhone 4S does not work after update iOS 6.0

    This sounds more like a hardware issue.
    Have you checked that the dock connector port is not dirty?

  • Apple TV does not work after trying to update software. Main light keeps blinking and on the screen shows itunes icon and a usb cable. What does that means?

    My Apple TV does not work after trying to install the new software update. The main light keeps blinking rapidly and on the screen it shows the itunes icon and a USB cable. What does that mean?

    The Apple TV is in recovery mode. Try to restore the Apple TV. Follow the link for instructions on the restore process.
    http://support.apple.com/kb/HT4367

Maybe you are looking for

  • Video from PP (via Presenter) doesn't play in Connect Meeting

    Running Connect Pro SP2 and Presenter 7.0.2. When I make a PowerPoint and import a video via the Presenter plug-in, I can publish it as content to the server, and the video plays.  But when I share the presentation to a meeting, the video does not wo

  • Why can't I see my downloads in my pop up download window?

    why can't I see my downloads in my pop up window for downloads anymore?  I can find it when I go to my dowload file nder finder but it used to show automaticially in a download window... but not anymore???

  • I am looking to learn how jax-ws handle attachments, specially for a sample

    Hi Thank you for reading my post. Its some days that i try to create a pair of client and a web service that could handle attachments (I must use Jax-WS ) but i can not find any document that show how to create the service itself. All Sun tutorials a

  • Printing a portion of a Numbers Spreadsheet

    I've generated a spreadsheet in numbers, and I would like to print a portion of the spreadsheet. I have selected the portion I want to print and and I select print preview the whole page is given to print, multiple pages,etc..It's a simple spreadshee

  • V_T5R05 - IT185

    When looking at the table V_T5R05 for IT0185 there is an entry for 'Prog Name 'and when do a F1 look up it talks about a report.  Has anybody used this field, if so for what purpose? Thanks WB