Help with making JLabel visible for a few seconds only

Hello guys,
I need help with making a JLabel object visible for a few seconds only and disappear when a JButton has been clicked.
Here is piece of code where I add mouse listener to the JButton object in my case is (jrbFigure1) and
when is called sets icon and text to the JLabel jlbl object:
jrbFigure1.addMouseListener(new MouseAdapter() {
jrbFigure1.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
jlbl.setIcon(cross);
jlbl.setText(wrong);
This piece of code is in a switch statement, the statement is in a method.
The JLabel jlbl object is added in a panel in the constructor of the class.
I really hope someone could help me on this issue.
I would like to thank you in advance for any help or advice given.

Bobson wrote:
Sorry for posting my issue twice, I thought, I posted it in a wrong forum:)It's OK. We'll ask the mods to delete the other thread.
I want the label to appear for X seconds when then button is pressed and disappear after that.Then a Swing Timer is what you want to use.
I need to do this in a number of cases from a switch statement because I several buttons.Better to have several ActionListeners, one for each button or each type of button, rather than one ActionListener with a large switch statement, a so-called switch-board listener. They're messy to debug and upgrade.
I tried to use Swing Timer, but I cannot set it properly.Go through the Sun Swing tutorial on Swing Timers. It's all outlined for you there: [http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html]

Similar Messages

  • When workign with video, logic freezes for a few seconds then playbacks

    Dear all,
    When i am working with video in logic 9.1, the playback freezes for a few seconds and then plays smoothly. This is irritating as when u score for movies, u cant sync the sounds. I tried converting the mov file into various formats, but still no luck. Strangely, the demos given with logic(the ones with videos) plays smoothly without the freezing.. pls help ...
    thanks
    Message was edited by: Rishikesh hari

    Ken,
    Yes , you were right. i researched on video formats and found, logic will only support uncompressed video formats. Like u said, i opened quicktime and exported my movie to DV coding. It works fine.. I also found out that, to have less CPU load, convert you video to "photo jpeg" coding.. Its smoother !!!1
    Cheers

  • Macbook Air only connects to the internet for a few seconds at a time.

    My 2013 Macbook Air (10.8.5) will only connect to the internet for a few seconds. It recognizes the wifi, but will just timeout when trying to access a website. If I turn Wifi off and then back on, it will work for another few seconds, only for the same issue to come up. I've tried EVERY SINGLE troubleshooting tip I could find and nothing works. I've renewed DCHP, rebooted my Mac, rebooted the router, network diagnostics, everything. I've scanned with Sophos multiple times and nothing has been detected. My 2007 MacBook Pro works just fine on the network as well as my roommates Macbook and my Apple TV. I have no clue how to fix it and am praying someone knows what to do. Please help!

    Start by getting rid of "Sophos," which is worse than useless.
    Remove the Sophos product by following the instructions on this page, and also this one, if applicable. If you have a different version, the procedure may be different.
    Back up all data before making any changes.

  • IPhone 3G displays apple logo for a few seconds then reboots (continuously)

    Hi all,
    So far my iPhone has gone from not turning at all to booting with the apple logo for a few seconds, then disappearing. My device will do this over and over again until the battery is dead. When I plug it into my computer, it works completely fine, syncs, restores, etc. The phone will remain powered on after unplugging from my computer, but my screen is unresponsive to touch and occasionally the lcd will become very dark (dimmed)
    My assumption as of right now is that it is a hardware issue, any suggestions or pointers for my next steps? I'm running out of ideas before I give it up and send it to apple

    Hello xtn,
    As paulcb mentioned, try resetting the iPhone. The behavior you've mentioned would be consistent with a stuck Sleep/Power button. However, it is odd that it mounts and works OK with your computer. A physically stuck button would tend to cause the iPhone to repeatedly mount and dismount from iTunes as well.
    One last thing you can try is to restore the iPhone and set it up as a new phone.
    If the issue persists, you may need to have it serviced:
    http://www.apple.com/ca/support/iphone/service/faq/
    Charles H.

  • I have an ipad mini 1st gen 64 gb (wifi only) and i have problem with some of my apps. These apps have lags when you play with them for a few seconds the apps are having lags are call of duty strike team, gta San Andreas and nfs most wanted.pleas help me

    I have an ipad mini 1st gen 64 gb (wifi only) and i have problem with some of my apps. These apps have lags when you play with them for a few seconds the apps are having lags are call of duty strike team, gta San Andreas and nfs most wanted.pleas help me

    I'm going to guess videos buffer for a while also...
    Two possibilities, one is you should close apps on the iPad, the other is your internet speed is not able to handle the demands of a high speed device.
    To close apps:   Double click home button, swipe up to close the apps.
    To solve internet problem, contact your provider.   Basic internet is not enough for video games and movies.   Your router may be old and slow.

  • I'm having problems with my app, plants vs. zombies 2. It'll open and stay open for a few seconds then shut down. Help please.

    I'm having problems with my app, plants vs. zombies 2. It'll open and stay open for a few seconds then shut down. Help please.

    Check to see if there are Updates available... If already up to date...
    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • My iMac os 10.7.4 Lion purchased 2/12 has jerky videos.  I've tried watching you tube and other videos with Safari and Google Chrome and sometimes they don;t jerk but most of the time the spinning globe appears and the video stops for a few seconds.  Help

    my iMac os lion 10.7.4 has jerky videos.  I've tried YouTube videos with Safari and Google Chrome and the spinning globe appears and the video stops for a few seconds.  I can't watch the white house weeklky address because it stops and starts every few seconds.  The software is up to date.  Just bought this thing in February 2012.  Can anyone help me? 

    Contact Apple Service, iMac Service or Apple's Express Lane. Do note that if you have AppleCare's protection plan and you're within 50 miles (80 KM) of an Apple repair station, you're eligible for onsite repair since yours is a desktop machine. Might also apply to new machines w/o AppleCare.

  • Audio cuts out at times for a few seconds with VOD

    While watching VOD the audio will cut out at times when the program is playing.  I have reset the boxes, and router with no change.  I have read on a post that someone had pixilation issues and the Verizon techs hooked up a cat5e from the ONT directly into the router, which solved her issues.  Is this something I can do, and will it help my issues?
    Thanks, Charlie

    Today I tried to find the answer to my question, again... And tot my surprise I found it!! When I played music with winamp I saw in the systemtray that the Creative volumecontrol actually did mute the sound automatically for a few seconds. The reason for this I don't know. In de surround mixer I clicked standard. Music is playing ok now., no more interupptions. Seems to me something is wrong with the Creative software.....

  • Toshiba 46G310U turns on for a few seconds the goes black with a horizontal line

    I have a Toshiba 46G310U that when it is first plugged up it will come on for a few seconds and show a great beautiful picture, then the screen goes dark with a horizontal line across the screen that eventually fades out too. Turning the TV off and back on does not help, If I leave it unplugged for 5 minutes with the source unplugged also, it will come on when plugged back up for a few minutes at the most then starts the whole turning dark with the horizontal line that fades completely out. I've aready replaced the inverter board, the T-con board, and now I am at a stand still because I can find any help with the problem for starters(Toshiba Tech support was NO help and was unwilling to listen to my problem), second I am thinking possible power supply problem but I am having problems finding the power supply board, the main logic board, and the two small narrow boards that the T-con plugs into above the LCD display. Display has to be good for the picture to be perfect before fading to dark. Back light is also good as I can see it when the display goes dark it still has a glow and with the back of the TV off I can see the actual back light panel shinning. Suggestions? No I won't call tech support back as it was a horrible experience dealing with the rude techs. Thanks in advance.

    The tech at Toshiba support was rude and seemed more interested in what was happening in the office then my issue with the TV. I've talked to a local tv service shop and they had no clue about the LCD type of tvs. I just would like to know if it is the main logic/input board or the power supply board. I can find the power board but have had no luck with the main board. Mr.. Moderator if you have any suggestions from Toshiba I would be very appreciative of your help. Thank y

  • Ipod touch 3rd generation will connect to my wifi for a few seconds and then nothing will load. help please?

    I have an ipod touch 3rd generation 64gb and it has iOS 5.1.1 and it will connect to my WiFi for a few seconds and then nothing will load. It says I have full connection bbut nothing works. I have 2nd generation ipod and it connects fine. Along with my laptop and xbox 360. I have tried downgrading it and restoring it from itunes. I also tried forgetting the network and inputting it myself but it sti does the same thing. I even tried resetting my wireless modem but it still didnt make a change. I really could use some help. I can't call apple cause im no longer under warranty.

    Reset the iPod and connect to its syncing computer.  It it shows in iTunes restore the iPod.
    Next see if placing the iPod in recovery mod will allow iTunes t see the iPod so you can restore the iPod.  For recovery mode see:
    iPhone and iPod touch: Unable to update or restore

  • TS1559 HELP!! I should automatically connect to wi-fi, it Wont! when i tell it to.... it only stays conected for a few seconds.

    Hi my iphone suddenly doesn't want to connect automatically to wifi!
    Even When I tell it to....
    It only stays connect for a few seconds.
    You return to wifi to find its turned off.
    The process starts again & Again & Again.
    With no success!
    Works fine on cellular data. I'm trying to update files that require you to connect to wi-fi,
    Because some Files are to big to update/upgrade using cellular dara?cellular!
    Has anyone else had this problem & worked out how to fix it.
    Please please please, help me!
    Remaining employed depends on it!! Thanks

    That is how your ipad is designed to work.
    Maybe try resetting network settings. If all else fails you can do a back up and restore as new to be certain there is no issue with your software.

  • Please help: Mouse cursor on MBP repeatedly freezing for a few seconds

    Hi all
    I bought a MBP last week, and today I started experiencing problems with the mouse cursor. No matter whether I'm using the trackpad or an external mouse (I've tried using both a wired Mighty Mouse and a wireless Logitech), when I'm moving the cursor it keeps freezing for a few seconds (perhaps less than a second), and then I "regain" control of it, only for it to freeze again after a short while.
    The only thing that I can think of that might have something to do with this is that I replaced the 2GB of Apple RAM with 4GB of OWC RAM a couple of days ago. Can this be the reason?
    Please help me, as this problem renders the computer impossible to use:(
    Thanks in advance
    Daniel
    PS: I'm running Mac OS 10.5.1 and I've got the Keyboard Freeze Update Installed.

    Hi.
    I have a similar problem, however I realized it is somehow related to weather the airport is on. If I turn it off, there are no freezes. It is weird, and I'm going to go with it to Apple.

  • Having issues with hard drive, trying to start up football manager 2015 but it reads for a few seconds then ejects itself , ive tried other cds and it reads fine so tried older versions of football manager which ive used before and they dont either

    im having issues with hard drive im trying to install football manager 2015 it reads disk for a few seconds then ejects itself other cds read fine
    and have tried older versions of football manager and they dont read either
    any help would be greatly appreciated
    thanks

    Try resetting the SMC 2-3 times, if that does not work then the DVD may need cleaning. Get a dry cleaning kit from your local office supply store.
    Intel iMac SMC and PRAM resets

  • Nano 6th turns on for a few seconds then screen goes black and nothing. what is wrong with it....

    My 6th gen nano turns on for a few seconds, then screen goes black and nano goes off. what is wrong with it? can any one help me out? do I need new battery? do I need a full repair? or is there something I can do myself to fix it.  Thanks for your help. 

    At the moment I say as I've fixed, momentarily:
    I made a downgrade to 1.0
    The problem, gentlemen, is the upgrade from 1.1 and 1.2
    It is a pity that I lost all the new features offered by the new firmware , just because Apple staff could not think to try this new update, on ipods with some airtime.
    I hope Apple pull out a version 1.3 with the ability to choose the feature detection, and the user can disable it at will.

  • After applying update my apple tv2 will randomly go to a black screen that lasts for a few seconds. When it gets back to normal after a few seconds it acts like the video never stopped since its farther along in the timeline. This happens with all video c

    After applying update my apple tv2 will randomly go to a black screen that lasts for a few seconds. When it gets back to normal after a few seconds it acts like the video never stopped since its farther along in the timeline. This happens with all video content wether its from Netflix or streaming from my iTunes library

    You might try restarting the Apple TV by removing ALL the cables for a 30 seconds. If that doesn't help try using another HDMI cable.

Maybe you are looking for

  • Time Capsule won't recognize External Hard Drive?

    Ok so I have a 1 TB Time Capsule that I previously had a 1 TB G-Drive attached to store excess data, movies, ect. I needed more space so I purchesed a 6TB G-Drive, connected it to my Mac Book Pro and coppied all the information to it from my other tw

  • IDOC to JDBC Scenario error

    Hi All, I am doing a IDOC to JDBC Scenario.I am done with IR and ID. The Table in the DB is TABLE1 with Field1 and Field2. Now when I run thescenario it throws an error , 2009-03-19 12:41:06 Success INSERT INTO  TABLE1 (Field1, Field2) VALUES (KM2478

  • Opportunities with volume changes

    Our company has opportunities that can bring in revenue over several months, quarters, or even years. More often than not, a volume trend will be associated with the revenue. Is there a way to properly forecast the volume changes within a particular

  • Windows XP & Virtual PC 7

    Does anybody here know whether the copy of Window XP Pro that you get when you buy Virtual PC with XP Pro is the Full version or an OEM? Also, does Windows XP come on a seperate disc? TIA, David

  • RAC Implementation in Oracle 11g

    How to implement RAC in oracle 11gR2? is there any documentaion or links to get more info on Oracle RAC