ListCellRenderer wont update until selected

Hi,
I wonder if anyone could help, I have been implementing a ListCellRenderer, and have just changed it to inherit DefaultListCellRenderer. However, either way the JList will only update when an (or any for that matter) element is selected in it. The minute you click the JList though, it updates just as it should. Here's the code
/* Custom cell renderer for the JList */
class MyCellRenderer extends DefaultListCellRenderer {
     public ImageIcon onlineIcn, offlineIcn;
     public MyCellRenderer() {
          setOpaque(true);
     public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
          ImageIcon onlineIcn = new ImageIcon("icons/status_online.png");
          ImageIcon offlineIcn = new ImageIcon("icons/status_offline.png");
          String s = value.toString();
          JLabel moo = new JLabel();
          contact con = (contact) value;
          moo.setText(con.getName());
          moo.setIcon(con.getStatus().equals("online") ? onlineIcn : offlineIcn);
          moo.setBackground(isSelected ? Color.lightGray : Color.white);
          moo.setForeground(con.getStatus().equals("online") ? Color.green : Color.red);
          return moo;
}Oh and here is the JList being called:
model = new DefaultListModel();
list = new JList(model);
list.setCellRenderer(new MyCellRenderer());

Whenever you modify the data that will affect what is being displayed in the JList... call JList.repaint();
A good way to see if you need to repaint something is to slide your component off the screen and pull it back on. If the new information is there only after sliding the component off the screen... then it just needed to be repainted.
So... from your post... it sounds like you need to repaint your JList once you modify the data that will update the cell. Then it should look like a live update.
-Js

Similar Messages

  • Ipod 5 wont update

    I have an ipod 5 that is not even a year old and it will not let me update my apps. When I click the update it asks for my password and after i put it in it looks like its going to start but then it just stops...no message or anything. Also when im on Facebook or checking my email and i click on recent post it will just keep saying updating but wont update until i restart my ipod. Anyone have any idea what might be causing this?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>iTunes and App stores and sign out and sign back in
    - Update the apps in your iTunes library and then sync.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.

  • IPod Nano wont update songs!!!

    Okay, when I plug my ipod nano into the USB port and my itunes pop up, the stage where my ipod would usually update itself is replaced with a popup window that says: Songs on "iPod Nano" cannot be updated because of all the playlists selected for updating no longer exist.
    Yes, I have no playlists right now, for some reason in the past I deleted them all. But this problem has erased all the songs and things I have on my ipod and since it wont update my songs I cant seem to put them back in (this includes the burned ones and ones bought from the music store). I am totally confused on what to do, someone PLEASE help!!

    Okay, when I plug my ipod nano into the USB port and
    my itunes pop up, the stage where my ipod would
    usually update itself is replaced with a popup window
    that says: Songs on "iPod Nano" cannot be updated
    because of all the playlists selected for updating no
    longer exist.
    I am experiencing, for the first time, a VERY similar issue; except I have MANY playlists, and, up until now, I have been able to selectively manage them on my iPod (2Gb iPod, 60Gb of music). Now, all of a sudden, I get the error that is quoted above, although I have already restored iPod twice, reinstalled iTunes once, as well as selected manual sync, and they all "crap-out" about 1/3 of the way thru the synch-job. Never before have I had any similar problems with my product. Please help.
    Frankenstein (Home-Grown)   Windows XP Pro   Mixed Components - PLENTY of Muscle and Space

  • Apps Wont Update on Family iTunes

    Dear Forum
    I have changed my wife from my iTunes account to her own iTunes account and made her part of my Family account with me the lead account. Now lots of her apps on her iPhone 6 wont update. Is this to be expected? i thought that if the accounts were linked then she could purchase, and iunb this case, update apps, with her own password???

    Try the following:
    1. Turn iPad off and on again
    2. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo
    3. Settings>General>Reset>Reset all settings
    4. Use iTune (computer) to update/download and sync to iPad

  • Apps wont update on ipad 3

    I have a 3 week old Gen 3 ipad 64gb, All of a sudden apps wont update, they just say waiting, I have tried rebooting, as well as deleating and trying to reinstall them.  I have logged out and back in again to Itunes/App Store.  This unit has pleanty of memory and Is brand new.  Any advice?

    Try the following:
    1. Turn iPad off and on again
    2. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo
    3. Settings>General>Reset>Reset all settings
    4. Use iTune (computer) to update/download and sync to iPad

  • IPod Nano wont updat songs!!!

    Okay, when I plug my ipod nano into the USB port and my itunes pop up, the stage where my ipod would usually update itself is replaced with a popup window that says: Songs on "iPod Nano" cannot be updated because of all the playlists selected for updating no longer exist.
    Yes, I have no playlists right now, for some reason in the past I deleted them all. But this problem has erased all the songs and things I have on my ipod and since it wont update my songs I cant seem to put them back in (this includes the burned ones and ones bought from the music store). I am totally confused on what to do, someone PLEASE help!!

    And I have no songs in my iPod but it says that I'm using 416 KB and still have 892.1 MB free storage left!!

  • It wont UPDATE

    I have written this code, it works perfectly but it wont edit (update) the selected data. have I missed something.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.OleDb;
    namespace Registry
        public partial class Form10 : Form
            private OleDbConnection connection = new OleDbConnection();
            public Form10()
                InitializeComponent();
            connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\fredhope\Desktop\Registry Access\registry.accdb;
    Persist Security Info=False;";
            load_table();
            void load_table()
                try
                    connection.Open();
                    OleDbCommand command = new OleDbCommand();
                    command.Connection = connection;
                   // string query = "select * from registry";
                    string query = "select ID,siku,sfnumber,shelf,raw,column from registry";
                    command.CommandText = query;
                    OleDbDataAdapter da = new OleDbDataAdapter(command);
                    DataTable dt = new DataTable();
                    da.Fill(dt);
                    dataGridView1.DataSource = dt;
                    connection.Close();
                catch (Exception ex)
                    MessageBox.Show("Error " + ex);
            private void button1_Click(object sender, EventArgs e)
                try
                    connection.Open();
                    OleDbCommand command = new OleDbCommand();
                    command.Connection = connection;
                    string query = "UPDATE [registry] SET [siku]='" + dateTimePicker1.Text + "',[shelf]='" + txt_shelf.Text + "',[raw]='" +
    txt_raw.Text + "',[column]='" + txt_column.Text + "' where [sfnumber]='" + txt_sfnumber + "'";
                    MessageBox.Show(query);
                    command.CommandText = query;
                    command.ExecuteNonQuery();
                    MessageBox.Show("Data Edited Successful");
                    connection.Close();
                catch (Exception ex)
                    MessageBox.Show("Error " + ex);
            private void button2_Click(object sender, EventArgs e)
                Form4 m = new Form4();
                m.Show();
                Form10 f = new Form10();
                this.Visible = false;
                this.Hide();
            private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
                try
                    connection.Open();
                    OleDbCommand command = new OleDbCommand();
                    command.Connection = connection;
                    string query = "select * from [registry] where [sfnumber]='"+comboBox1.Text+"'";
                    command.CommandText = query;
                    OleDbDataReader reader = command.ExecuteReader();
                    while (reader.Read())
                      //  dateTimePicker1.Text = reader["siku"].ToString();
                     //   txt_sfnumber.Text = reader["sfnumber"].ToString();
                     //   txt_casezone.Text = reader["casezone"].ToString();
                     //   txt_casetype.Text = reader["casetype"].ToString();
                    //    txt_appellant.Text = reader["appellant"].ToString();
                   //     txt_respondant.Text = reader["respondant"].ToString();
                   //     txt_shelf.Text = reader["shelf"].ToString();
                  //      txt_raw.Text = reader["raw"].ToString();
                  //      txt_column.Text = reader["column"].ToString();
                       //other way
                        string dateTimePicker1 = reader["siku"].ToString();
                        string sfnumber = reader["sfnumber"].ToString();
                        string casezone = reader["casezone"].ToString();
                        string casetype = reader["casetype"].ToString();
                        string appellant = reader["appellant"].ToString();
                        string respondant = reader["respondant"].ToString();
                        string shelf = reader["shelf"].ToString();
                        string raw = reader["raw"].ToString();
                        string column = reader["column"].ToString();
                    connection.Close();
                catch(Exception ex)
                    MessageBox.Show("Error  " + ex);

    Hi 19fred88,
    From your query string, I found txt_sfnumber is not using .Text property. If txt_sfnumber is a TextBox, you need to use txt_sfnumber.Text to get its value.
    string query = "UPDATE [registry] SET [siku]='" + dateTimePicker1.Text + "',[shelf]='" + txt_shelf.Text + "',[raw]='" + txt_raw.Text + "',[column]='" + txt_column.Text + "' where [sfnumber]='" + txt_sfnumber.Text + "'";
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Ipod wont update, restore, WORK!!??

    hi everyone, my ipod's been playing up, its the second time this has happened, the last time i managed to sort out the problem but it was an accident! It started off by suddenly deleting all the songs in my ipod, they're still in my library but wont update onto my ipod, saying there is not enough memory. I have tried resetting, and then update/restoring but I keep getting a range of different error messages from "Internal error" to "formatting failure" i have searched through all the discussions on here but none have helped!! the ipod updater i downloaded seems to disappear on my computer leaving one from jan06, which is obviously out of date. PLEASE HELP!!!!
    thanks xxx

    You've seen this?
    Internal manager error.
    If after trying all else, you could try a format of the iPod in Windows. A full format does a check and remap of bad sectors on the iPod hard drive, and you would need to restore the iPod as normal (using the iPod updater) afterward. This can also work when the iPod is recognized by the computer, but not by the updater.
    First, put the iPod into forced disk mode.
    See: How to put the iPod into disk mode.
    On your PC, go "my computer" and right click on the iPod, then choose "format". Ensure the settings are at "default" and that "quick format" is not checked. Now select "format". It will take a while, but when that's finished, restore the iPod using the updater.
    If you need to, reset the iPod to exit disk mode.

  • Automatic updates wont update to Camera Raw 8.5

    Hi Guys,
    Yet again new release of CC and the Camera Raw wont update on my iMAC and Macbook Pro both running latest versions of Maverick and Creative Cloud..   I have used CC to update Lightroom and Photoshop to the current versions (5.5 and CC2014 respectively) yet the Camera Raw is still maintained at 8.4 and gives me a warning message every time I try and edit an image from LR to PS.  Creative Cloud App says all the apps are current and when using the check for updates option in CC2014 it says all up to date.
    Had the same issue with Raw 8.4 and way round it was to manually update the Raw file in the respective location.   Unfortunately I can not remember which locations and haven't found a link to download the updated file as yet.
    Tried Adobe online support but their 'specialist' team doesn't seem to work the same hours I am available (despite being a major international company )
    Any help gratefully received!
    Mark

    Please follow the below mentioned steps to resolve the issue:
    Quit and Relaunch CC app
            http://helpx.adobe.com/creative-cloud/kb/creative-cloud-connection-faq.html#id_10491
    Open the Adobe Creative Cloud application.
    Mac OS: Go to the Applications folder and open the Adobe Creative Cloud alias.
    Windows 7: Go to Start > All Programs > Adobe Creative Cloud
    Windows 8: Open the Adobe Creative Cloud application from the Start Screen.
    Click the Apps tab in the Adobe Creative Cloud applications.
    Click on All Apps, then Previous Version
    Your installed CC Product would be listed, Click on Install Drop-down and then select the CC 2014 to install.
    After Successful Installation, Update your Product
    Let me know if you are still not able to Update ACR.
    Regards,
    Ashutosh

  • I have a first generation MacBook Air that has been refurbished via the Apple store. I installed Snow Leopard about a year ago and now, my computer wont update! It will download the updates restart my computer, but then I get an error message!

    I have a first generation MacBook Air that has been refurbished via the Apple store. I installed Snow Leopard about a year ago and now, my computer wont update! It will download the updates restart my computer, but then I get an error message and the computer wont restart!

    What is a error message and what do you see when it appears?
    Haven't much problem with Airs around here, since they have a SSD they tend to be more reliable.
    Perhaps it was a bad update, have you ran through this list of possible fixes?
    Do as many as possible, starting with #1. Until the problem is resolved.
    Use the boot 10.6 USB instead of the disk of course.
    Step by Step to fix your Mac

  • A recent Photoshop CC update now selects the wrong video adapter and disables 3d

    My asus laptop has an ivy bridge processor with included HD graphics and an NVIDIA 650M Graphics Adapter.  Until i recently updated Photoshop CC, i was able to do 3d without issue in Photoshop as the 650M has 2 GB of video ram.  Since the update, Phtoshop selects the Intel HD4000 which only has 32 MB of video ram, so 3d is disabled. 
    I've tried the bios, even though all i did was update photoshop, and there is not setting for default.
    I'm running win 7 home premium,8 GB memory

    We have released a new update(14.1.1) for Photoshop CC, please update to the latest and let us know it ot solves your issue.
    See the following thread for more info on the update:
    http://forums.adobe.com/message/5674936#5674936
    Regards
    Pragya

  • After deleting firefox and reinstalling it Ikeep getting a message telling me that it cant be updated until i deleate the original programme how do I get rid of that message

    after deleting firefox and reinstalling it Ikeep getting a message telling me that it cant be updated until i deleate the original programme how do I get rid of that message

    You seem to be running the latest Firefox 9.0.1 version according to the user agent in your system details list:
    *Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
    Do a clean (re)install and delete the Firefox program folder (C:\Program Files\Mozilla Firefox\).
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 9.0.x: http://www.mozilla.com/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible.
    *Do NOT remove personal data when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    * http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • N97 mini wont update to latest software

    heloo i bought this phone while i was on holiday in malaysia as my samsung galaxy note was stolen!!!!!!!!!!!!!!!!!!!!!!!!!!! and oh my god.. it wont update to 30.0.004... rite now it just says rm 555 10.0.020... it sux!! very buggy.. kinda need a new update fast...the software version date is 14-10-09... 2 years ago?? r u kidding me???? HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi,
    I suggest backing up your data via Nokia Suite, then perform soft reset by pressing *#7780# followed by your security code. Then retry your software update by following the instructions below.
    If you use a PC, Nokia Suite can check your phone’s current software version and download new versions when they become available, using your PC’s internet connection.
    Nokia Suite also helps you to back up your contacts and photos, synchronise your calendar and update other applications such as Maps.
    To update your phone’s software using Nokia Suite on your PC:
    On your PC, open Nokia Suite and connect your phone
    In Nokia Suite, select Tools > Software updates.
    From the list of available updates, choose what you’d like to install.
    It’s free to download and use Nokia Suite. It runs on Windows 7, Windows Vista and Windows XP.
    Note: If you’re a Mac user, you need to update your software from your device as Nokia Suite is not available for Mac OS.
    Hope this helps,
    Thanks Whizzkid

  • Pages "have not owned the major version of this software" wont open wont update

    My pages wont update since i "have not owned the major version of this software" then it wont let me open pages because its being updated...HELP I have so many essays to write.

    What version of pages were you using? How was it purchased?
    What version of OS X?
    Apple has gone through several variations on the purchase/licensing of iWork and Pages, and the advice on what to do will vary with the method that Pages was obtained and installed.
    In the meantime, you could rough out your essays on Text Edit, found in the Utilities folder in your Applications folder, or download and install one of the open source office applications, OpenOffice.org, LibraOffice or NeoOffice. None are a direct replacement for Pages, but they should be able to get you through until you have Pages back.
    Regards,
    Barry

  • Ios 6.1.3 wont update any of my apps crashes every time

    so basically my problem is that ios 6.1.3 wont update any of my apps it says app has failed to download click here to retry is this just a temporary issuse or something more severe please answer this for me thanks bye!

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>iTuns and App stores and sign out and sign back in
    - Update the apps in your iTunes library and then sync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

Maybe you are looking for

  • I upgraded to version 10.6.8 and safari will not open

    I'm receiving the message "safari quit unexpectedly" since the software upgrade

  • [FYI] Adobe Reader 7.0.9 リリース

    AdobeR Reader 7.0.8での脆弱性はAdobe Reader 8で解消されているが.会社などではそう簡単にはAdobe Reader 8に移行できないという場合もある. そのようなユーザ向けといっていい「Adobe Reader 7.0.9」がリリースされた. Adobe Reader 7.0.8の[ヘルプ/アップデートの有無をいますぐチェック]を行うと.Adobe Reader 7.0.9 Update がリストアップされる. リストアップ画面での説明は以下のように. > Ado

  • App not loading - Note Taker HD

    Hello, I am in need of some assistance with an App on my iPAD 3 I have an app Note Taker HD, that will no longer load.  When I select the app and it pops up and says its loading, but then after a couple of mins the screen closes and goes back the mai

  • Cancellation of confimations

    Hi PP Gurus, I have a problem while cancellation of conformations. I have created a Production order and confirmed the same by co11n, the same is cleared in quality also. I want to cancel the above confimation By using co13 i have cancelled the same.

  • Regarding mapping trace

    MappingTrace trace;      trace.addInfo("mapping started"); This is the code that we are using to trace the mapping in XI, but on execution of the code we are getting java.lang.NullPointerException. can you please provide us with a solution to it. Tha