Lost CellRenderer when updating TableModel

I am working on some code, where I need to modify the displayed columns in a table.
The table consists of cells that uses a custom CellRenderer implemented by the class MonitorCellRenderer.
So far I have some of the functionality working in that I can make the table display less columns. This is achieved by modifying the data stored in the TableModel. In fact what I do is re-create the Column Headers and data.
This is all achieved by firing a fireTableStructureChanged() event. Then I recompose the data in the Table Model. I call JTable.setModel() with the Table Model reference again, and the table is re-structured. BUT....
The cell rendering does not work, all that is displayed is the object reference for the data (The data for each cell is stored in an object). This is the same as would have happened if I had not initialised a CellRenderer for the table, so I implemented the following code in my TableModelListener
for(int col = 0; col < monitorTable.getModel().getColumnCount(); col++)
         column = monitorTable.getColumnModel().getColumn(col);
         column.setCellRenderer(new MonitorCellRenderer());
         column.setPreferredWidth(100);
         column.setResizable(false);
      }monitorTable is the JTable. This code is cribbed from the inital set up for the table, so is essentially what I want. What I have found is that these settings for the column are ignored, because if I change the preferred width, it does not change.
I'm thinking that somehow my table ColumnModel reference is wrong, because it is referencing something else.
Can anyone suggest what may be going wrong.
Thanks

This is all achieved by firing a fireTableStructureChanged() event.This causes the TableColumnModel to be recreated from scratch, therefore you lose renderers and editors that have manually been assigned to the table.
So far I have some of the functionality working in that I can make the
table display less columns. This is achieved by modifying the data
stored in the TableModel. In fact what I do is re-create the Column Headers and data.Sounds unecessary to me. Just remove the TableColumn from the TableColumnModel and the table will be painted correctly. There is no need to play with the data in the TableModel.

Similar Messages

  • Lost contacts when updating to OS 5

    I updated my iphone 4g to OS5 last night and lost all of my contacts.  Is there a way to download my contacts from my imac back onto my phone?

    When I go to settings, then icloud, if I scroll to the very bottom of icloud, the very last thing I can do is 'delete account.'  Does that mean delete the icloud account?
    Ian, I see that you have answered many questions from several people on this board and I for one want to thank you for taking the time to do so.  I' ve had my iphone for quite a while and am still very afraid of it.  I use it for the phone, getting my emails, and messaging.  I have never used any of the other features. 
    Now that I updated and lost my contacts, it confirms why I am so afraid of it.
    I would never use icloud so I can't even tell you why I got it.

  • Lost apps when updated to nokia belle.

    after I updated my nokia n8 to belle, some of my applications and games are gone but the memory of my phone is the same as if it doesn't lost any apps. Is there any way to retrieve/locate them?

    I got same problem too with my N8. Some apps are also visible as icons but i found that ALL are actually shown as installed in Settings->Installations->Installed (freely translated). But "naturally" there is no way to add an shortcut/icon from that list, or to reinstall it easily.
    And, when i tried to go into Ovi app it demands that i update to version -- and its installer starts but fails towards the end displaying black screen shorlty before disappearing. I've tried many times. And according to log it is Installed but it keeps saying i need new version. Maybe it's because, when i earlier went to a web like in ovi.com, it sillily enough asked me to install some 2.x version of ovi!
    Also, i hope that when i reinstall the apps from Ovi, it won't charge again for the paid ones which at least the Nokia suite lists for me.
    PS. It's possible that the fix i found to nonfunctional WLAN, resetting the phone data+restore from pre-upgrade backup, has caused aditional corruption. And btw, i'm far from sure Belle is better -- it's still slow and weblets have bad design with too much space around them and, so far, no resize opion. And calendat weblet show only one appointment (but at least it isn't repeating like in Anna : "you have meeting on Thursday" + "thu 1.2 meeting..."
    Hope Nokia will test future updates better next time... and advice us how to for instance get shortcuts/icons back.
    Update: Now, trying to get Ovi App work, i accepted to install the 2.x version. It succeded but now the app goes stays in Loading... (forever it seems). Can this be installed via USB?

  • Lost Notes When Updated to io7

    I lost all my notes, when I updated to io7. How can I retrieve my notes?

    All 3rd party apps on your iPhone should be in your iTunes library on your computer, and will or should be as long as you have Sync Apps selected under the Apps tab for your iPhone sync preferences with iTunes. With this selected, after downloading an app with your iPhone the app will be copied to your iTunes library automatically the first time you sync your iPhone with iTunes after doing so.
    You can re-download an app with iTunes on your computer or with your iPhone and you won't be charged again for a purchased app as long as you use the same iTunes account to re-download the app that was used to purchased the app originally.
    Check under Reinstalling the application with this link.
    http://support.apple.com/kb/ts1702

  • Lost voicemails when updating to 4.2.1

    When I updated to 4.2.1, I lost voicemails dating back to August that I need for court. It seems they are still there, since it says my mailbox is 97% full even though it is only displaying voicemails dating back to December. Is there any way I can recover these files? Are they stored in backup files as texts are?

    Shalini1975 wrote:
    ...before the update, it was working PERFECTLY, which would lead me to believe the update did something to my phone.
    Uh, no. Software updates do not cause hardware to fail. If in fact it is a hardware failure, it is merely coincidence. A really crappy coincidence, but still a coincidence.
    Shalini1975 wrote:
    So basically, if I hadn't done the update, I would be fine.
    No guarantees, if it is a hardware issue, it could have still failed.
    Shalini1975 wrote:
    Either ATT or Apple needs to address this.
    Why? Your device is out of warranty. AT&T has nothing to do with this, it is ridiculous for anyone to state that the service provider has any responsibility for what is a hardware issue with your device.
    Why do you think Apple has a need to address this? You are out of warranty. The offer a $199 Out of Warranty exchange if this is in fact a hardware issue. That is the extent of their responsibility.
    Depending on how long it has been since your warranty expired, you might find a sympathetic Apple employee that will overlook the fact that you are out of warranty, but I wouldn't count on that. They should be willing to look at the device and assist you in confirming that it is an actual hardware issue. At that point, it's your choice to do the Out of Warranty exchange or find another solution (3rd party repair company, find a different device, etc).

  • HT4623 I have lost YouTube when updating

    I have lost you tube when up dating to iOS 6. It is not in my iCloud memory have checked. It has just vanished. The iCloud memory only goes to after the update is the update the problem?

    YouTube is no longer a stand alone app in iOS 6, if you search the App Store for 'youtube', Google has it's own official App you can download and use to replace it.

  • Lost Apps when updating

    I just currently updated my ipod touch to 4.0.1 but when i downloaded it, it stopped at the end and had an error. so i just restored my ipod and when it restored it re-downloaded straight to 4.0.1 but it didn't back up my ipod when i clicked the back up button and so i lost many apps that i paid for. i went into the apps store to see if i could download them again for free but it says i have to buy them again. So i lost all my apps when it should have backed it up but it didnt back up anything and my ipod went straight back to retail home screen with none of my apps so i synced what i had thinking i could just download the ones that weren't there from the store again, but i can't. I need help on what to do to get my apps back without paying again for them

    Just got my new Ipod 4th Generation since 1 week. I have already download some App from AppStore and everything was working great since today when i updated my Battery Doctor Pro application and the update wont install. It change the Icon for a grey icon with « Waiting...» writing at the bottom... What the ** is that!!!??? I could download from the AppStore like 2 hours ago and suddenly it wont download...I just don't understand...is somebody have the same problem with the App Store or it is my Brand New Ipod!!???

  • Lost contacts when updated iPhone?  Where are they?

    Updated to 6.0.1. and when I went to use phone my contact have gone.  Any idea where they might be or how I can get them back?

    I've no idea what this is, sorry.  I've since tried a backup restore but only got favorite contacts back.  How would I find out what program is used during sync?

  • Lost photos when updated to iOS 5

    I updated mine and my husband's iPhone 4 this weekend to iOS 5.  We both had photos on our phones that were not previously dumped onto our PC hard drive.  My photos were still there, but my husband's are gone.  iTunes said the phone was backing up the phone, so they must be somewhere, but we just can't find out how to get them back.  The Genius Bar was unhelpful, so I was wondering if this happened to anyone else and what you did to get them back (if you were able to)?

    First things first, go to Settings > General > About. Look at photos. If it reads how many you originally had, they should be on your iPhone, just not showing up in the Photos app. This happened to me, it confused me very much, how could my Settings read that I had nearly 530 photos, but only about 150 actually show up? They were even in this tab called events, which disappeared when I did these two steps, which seem to have resolved my problem:
    1) Sign into iCloud and turn on photo stream.
    2) Power cycle the iPhone. (I think this is the step that actually resolved my problem)
    Like I said above, I think step 2 is what actually resolved my problem, as with many iDevices, a simple power cycle seems to resolve many issues. From what I have read online, it seems that when iTunes restores your iPhone after the iOS5 update, it relocates your photos to a different folder, which will be found after a power cycle. Once your phone powers back on, go into the Photos app and check for your photos, they should be there and in the original order they were in before the update! I hope this helps you, good luck!

  • Lost pictures when updating

    I updated my iphone 4 with ios5 and lost my pictures.  How do I find them?

    Did you fail to import them to your computer before updating?
    If so, then your only chance is to restore from backup.  If this failes, then they are gone.

  • I phone lost power when updating?

    Tried to update my i phone 3 to ios6 last night and the phone froze with black screen with apple icon. have tried rebotting by holding in lock screen and home button but just get screen showing no battery and the phone has been charging since 8pm last night

    Sounds like the battery is dying.  Bring your phone into Apple for evaluation

  • Lost apps when updated ipad to 5.0

    How to I re-download my purchased apps to my ipad?

    If they are on your computer's iTunes then you can sync them via the Apps tab, or if they are still available in the store and you use the same iTuens account as you originally used to buy/download them then you should be able to re-download them for free : http://support.apple.com/kb/HT2519

  • HT4623 When updating my iphone i lost all of my apps and the data on the apps. How do I get them back?

    When updating my iphone 4 for the first time I seem tohave lost all of my apps and the data on my apps. One of these apps was a camera and all of my photos are gone!! I had over 1000 pictures mostly of my children. I cant find them anywhere. Please help! How do i get all of my apps back with all of the data that was on them??  Thank you, LEC

    app store - update - purchased - all/not on this phone - select the app you want to download by clicking on the cloud next to it.

  • Music on my phone lost.  When I sync to I Tunes it doesn't add the music.  phone updated to 6.1.  how do I get the music back in the phone.

    Music loaded to my phone is lost.  When I resync to I Tunes it doesn't add the lost music.  My phone was updated to 6.1.  Any suggestions on how to restore the music to the I Phone?

    If the music is in iTunes you should be able to sync it back to your iPhone.
    What settings do you have in the iTunes Music tab for your device?
    Is Sync Music set?
    Is Entire music library checked?
    What happens when you sync?
    If iTunes is confused and thinks the music actually is on your iPhone you could try unchecking Sync Music and then sync. Follow this by checking Sync Music and then sync again.

  • I lost some photos when updating my OS, how can I find them

    I lost some photos when updating my OS, how can I find them.  I have already tried to restore through my PC but the photos are still not there.  Any thoughts?

    If you haven't backup up your phone, then your photos are gone.
    In addition you should import your photos to your PC, just like a ditigal camera, as a secondary backup in case you lose your pics you could always sync it back using Itunes.

Maybe you are looking for

  • Getting error while creating a table

    Hi there, I have created a user 'ram' and gave "create table" permissions for that user. After that, when I tried to create a table using the command create table countries as select * from hr.countries; where hr is another user and countries is the

  • Xsql multiple table insert

    I'm having trouble getting my xml document inserted into multiple tables. My xml has a parent child relationship. The main node is the parent I'll call <CAKE> then later on in the xml doc it has a node called <INGREDIENTS> which is a repeating elemen

  • Is it possible to install windows 7 on mac on a external HD?

    I would like to install windows 7 on my macbook pro but i can not afford the space on my internal HD, can i install windows 7 with bootcamp but have everything windows on my 500GB external drive, i also own parrallels desktop if bootcamp is not possi

  • USe of Business services with BPEL or ESB

    Hi, Has anyone come across any example on how to use Busiess services with BPEL or ESB. Oracle App Server , JDE 812 , Tools 8.98 , SOA suite 10g

  • Opening an image with PSE 11

    When i try to open an image in PSE 11 from Windows explorer by choosing "right click" - "open with Pse 11" the editor starts but does not open any file.  This was not the case in previous versions of Photshop Elements.  Any idea why this behaviour?