How to blink/update titlebar icon - without show()?

Hello,
I'm writing a Swing application which, when certain events occur, should display a blinking icon in the title bar.
I am using a TimerTask to change the icon, something like:
class BlinkIcon extends TimerTask {
boolean iconOn = false;
public void run() {
if (iconOn) {
frame.setIconImage(imageOn);
iconOn = false;
frame.setTitle("ON");
} else {
frame.setIconImage(iconOff);
frame.setTitle("OFF");
iconOn = true;
The problem is that, with the code above, only the text title of the window (JFrame) changes. The icon doesn't.
However, if I issue a frame.show() after changing the icon, the icon changes. But show() has the undesired effect of bringing the window on top.
Can someone else recommend a solution? Is there something else that I could use instead of show()?
Thank you!

Strange...tried this on one of my apps and it works with no problem. Running in Win 2K.
I'm wondering if you are running into problems due to the fact that most Swing components are not thread-safe, meaning that methods that cause a change in appearance to swing components should never be called outside the Swing Dispatch Thread. (The Timer class runs any scheduled TimerTask in its own thread.)
Have you tried moving your setTitle() and setIconImage() calls into a Runnable and scheduling that using javax.swing.SwingUtilities.invokeLater() in your TimerTask, rather than calling setTitle() and setIconImage() directly in your TimerTask?

Similar Messages

  • I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    - Have you tried a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Try syncing  the iPod to your computer. Then delete from iTunes and sync. that should delete it from the iPod. Then redownload it.

  • HT1338 how do I update my icon on my Mac desktop?

    How do I update my icon on my Mac Desktop?

    I can only surmise you are running 10.6.6 or later, since the Mac App Store became available then.  Go to Apple menu -> About This Mac and tell us your Mac OS X version.    Some Mac OS X versions could have their icons changed, while others could not.   I can get a moderator to move this thread to the correct forum once I know your version and know whether or not I can answer this question.

  • How can I get my icons to show after they are pined they only show up unde the browser icon

    how can I get my icons to show after they are pined

    What do you mean by icons? Website favicons for the tabs you have pinned? Your bookmarks? Something else?
    Please provide a screenshot.
    * https://support.mozilla.org/en-US/kb/how-do-i-create-screenshot-my-problem

  • HT1420 I just bought my cousin's ipod, and I want to update it on my computer.  However, it needs authorization from his account to keep all the apps, and he's already authorized it on 5 computers.  How can I update this ipod without losing all the apps?

    I just bought my cousin's ipod, and I want to update it on my computer.  However, it needs authorization from his account to keep all the apps, and he's already authorized it on 5 computers.  How can I update this ipod without losing all the apps?

    You cannot use someone else's apps without violating the license agreement. The apps are tied to the owner (via Apple ID). The right thing to do would be to update and start fresh.

  • I have an iPad that I want to update to IOS 5.1. I have several apps that each were installed using a different iTunes ID. How can I update the IOS without losing the apps?

    I have an iPad that I want to update to IOS 5.1. I have several apps that each were installed using a different iTunes ID. How can I update the IOS without losing the apps?

    To update your phone requires using the latest version of iTunes, on your computer, as well as Internet access. The update to iOS 5.0 or higher is an erase/restore deal, so you not only have to make sure all of the content, currently on your phone, is on your computer and accessible, you need to update iTunes first, have Internet access, then update your phone. There is no way around this fact. You could go to an Apple store or use another computer, but you run the risk of losing all of your data it you do that.

  • How can i update my contacts without spending MORE money on Cloud?

    how can i update my contacts without spending MORE money on Cloud?

    DroidZzz
    Apparently Google keeping a "copy of everything" isn't deterrent enough for you to get another device. Correct me if I'm wrong, but you've posted in the Android forum, indicating you have a Google product.
    Frankly, I could care less about them copying everything. I don't post or type anything online that's incriminating or private anyway. Technically, your ISP has access to anything and everything you transmit or receive through their network, anyway.

  • How to change Topic's Icon and show the Print Button

    Hi, currently i'm using robohelp html version 8. I have spent quite some time to figure out how to change topic's Icon and show the Print Button in my project. Anyone can help me on this? Btw, i using MX(template) to generate the output with FlashHelp Pro.
    Below is the screenshot for clearer clarification:
    Thanks.

    We would have told you if there was.
    Sorry but a downside of FlashHelp is that your customising options are limited.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • How do i update iphone 4 without losing my apps or music

    how do i update my iphone 4 without losing apps data music

    http://support.apple.com/kb/ht1848
    http://support.apple.com/kb/HT2519

  • HT2305 How do I update to iOS5 without losing all of my apps?

    How do I update my iPhone to iOS 5 without losing all of my apps?

    Yes, provided the old apps are compatible with the new OS.  BTW, double-check before in the Apps section of the iTunes library to be sure all your apps are listed there just in case. I usually sync twice just to be certain there is a backup.
    I also maintain backups of the computer just in case. You should have a current backup.

  • How do i update my itunes without reinstalling it?

    I need help udating my itunes on my computer. how do i update it without reinstalling it?

    Do you get an error message when you try to update iTunes? If so, what does it say? (Precise text, please.)

  • SW update notification icon not showing.

    hi, i have nokia N8 running symbian belle refresh. Automatic updates are set to on, and there is update to application also availlable but its not showing the update notification icon.
    I have another nokia n8 in which nokia belle came preinsatalled and that is showing update notification....dnt got it why....

    Thanks for the reply. Unfortunately, when I viewed this pane it was unchecked.
    II'll keep searching.
    Steve.

  • HT5577 My I'd has been suspended I canceled my credit card due to fraudulent charges how do I update my games without I'd?

    WHy has my I'd been suspended and how do I fix it. I shouldn't have to pay every month a charge ranging from 4 to 10 dollars to use my 900 dollar iPad

    Did you check your Purchase History why the charges?
    There's no way you can update your games without an Apple ID.
    http://support.apple.com/kb/ht2727

  • How can i update my itouch without deleting my media?

    how can i update my ipod touch on my laptop without deleting my media? everytime i try to update it, it tells me it will dete my media and i dont want it to. is there a way i can update it without deleting any media?

    All of your media and everything else should be on your computer. If it is not, then put it there.
    You can then sync it back after the update.

  • In Safari 7.0.3, how do I get website ICONS to show up in the bookmark favorites toolbar?

    RE:  Bookmarks/Website Icons in Favorites Bar
    In Safari 7.0.3, does anyone  know how to get website ICONS to show up in the bookmark favorites toolbar?
    Blue dots with the website name in text show up in the favorites bar.
    The website icons do show up in the bookmarks sidebar.
    Thanks!

    Nope, they don't - and we are up to version 7.1 now. I have done a good bit of searching on this subject, and it is a frequently asked question. I don't understand why Apple don't implement it.  It is the only reason I am currently using Chrome instead of Safari.  I have too many bookmarks on my toolbar for them all to have names, using the icons allows me to pack them in tight and have instant access to lots of sites I use frequently.

Maybe you are looking for