How to disable my Jbutton before a long operation?

I want to disable a button before sending email and enable it once it is finished, I know it is something to do with Swing thread, but I cant get it work, someone please help me...
The button can be disabled if i commented out sendEmail(...), sendEmail() is just function to send email using JavaMail API to send email to multiple recipients, so i guess the JavaMail uses thread for its process? How can I disable the button before sending emails?
          sendButton.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                         SwingUtilities.invokeLater(new Runnable() {
                              public void run() {
                                   sendButton.setText("Please wait...");
                                   sendButton.setEnabled(false);
                         /* some logic */
                         sendEmail();
                         sendButton.setEnabled(true);
                         sendButton.setText("Send Email");
          });

Kevin Workman wrote:
Kayaman wrote:
Kevin Workman wrote:
Kayaman wrote:
Use invokeAndWait().Why? He's in actionPerformed, so he's already on the EDT. Why use invokeAndAnything?Oh so now I'm expected to read the posts fully before answering.
I knew this move to Oracle would result in devastation.Hahaha. Where's the "like" button when you need it?Oh, please.
As if we need ANOTHER 'Like' button on the internet, with the 124131234621466123461^42 (approximately) that are out there at the moment >:(

Similar Messages

  • How to disable a flash trace in safar & opera browsers.

    hi
    I have installed flash player (16) debugger version for Mozilla, Now I am getting flash trace in mozilla, safari & opera. I want to disable the flash trace in safari & opera.
    Please tell me how to do this.
    thanks in advance

    Yeah, the debugger is for developers that need to write and debug Flash content.  You don't want to use it for general browsing.  It's much slower than the release player because of all the tracing, and it shows you everyone else's coding mistakes that didn't get fixed before they shipped (and there are a lot). 
    So, you'll need to uninstall and move back to a release player.  What most of us do is keep the debugger in one browser (like NPAPI Flash Player for Safari/Firefox) for doing web development, and then use another browser with the release player for actually browsing the web (like Chrome).  Since we're using two browsers with different plug-in architectures, we can keep them installed in parallel instead of switching back and forth.
    Anyway, here's the uninstaller:
    Uninstall Flash Player | Windows
    http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html
    Then just download the regular installer at:
    http://get.adobe.com/flashplayer/

  • How to disable camera for G+ Hangout?

    Anyone know how to disable the camera before entering into a G+ Hangout?

    just cover up the camera with tape/cardboard or something. Or, http://www.ehow.com/how_5799246_disable-isight-camera.html

  • HT4539 how to enable my apple id on iTunes? Somehow its disabled and I can no longer download Apps on my IPhone ??

    how to enable my apple id on iTunes? Somehow its disabled and I can no longer download Apps on my IPhone ??

    Depending on why it's been disabled you might be able to re-enable it via this page : http://appleid.apple.com, then 'reset your password'
    Or you might need to contact Apple : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
    If it then works on your computer's iTunes but not your phone then try logging out of your account on the phone by tapping on the id in Settings > Store (Settings > iTunes & App Stores on iOS 6) and then log back in and see if that 'refreshes' the account on it

  • How to disable Setting button in Tools - Options - Advanced - Network..i've read an article that solved this problem..but thats problem contains web adress that couldn't be opened..any other solution??? thanks before best regard

    How to disable Setting button in Tools - Options - Advanced - Network..i've read an article that solved this problem..but thats problem contains web adress that couldn't be opened..any other solution???
    thanks before
    best regard
    -ariansyah-

    You can disable or remove that button, but that won't prevent users from making the changes on the about:config page directly.<br />
    You can lock the related network.proxy prefs if you do not want users to change the connection settings.
    See:
    *http://kb.mozillazine.org/Locking_preferences
    * http://kb.mozillazine.org/network.proxy.type
    * http://kb.mozillazine.org/network.proxy.%28protocol%29
    * http://kb.mozillazine.org/network.proxy.%28protocol%29_port

  • My calendar notifications disappear about an hour before the event. How do I make them stay for longer?

    My calendar notifications disappear from the notification center about an hour before the event. How do I make them stay for longer? It is it's 5

    This is normal and is how Apple handles photos.
    There are NOT duplicate photos.
    Just as a song is in your itunes library and you can access that exact same song from a playlist,  all  photos synced to iphone are in the photo library and those exact same photos (NOT duplicates) can be accessed from the individual albums.
    It is working exactly as it should.

  • I just discovered that when I type names in Reminder, Notes or even email there is a voice repeating the names. Any idea how to disable this function? I never heard it before.

    I just discovered that when I type names in Reminder, Notes or even email there is a voice repeating them. Any idea how to disable this function??? I never heard this before and I have the iPod Touch since a year!. Thanks a lot.

    You have an Accessibility feature turned on. Go to Settings>General>Accessibility and turn off/check off:
    VoiceOver
    Speak Selection
    Speak Auto-text.

  • How to disable iMessage for a specific contact/How to unregister iMessage from former device

    I switched from an iPhone 4 to a Galaxy S3. When my wife who still has an iPhone 4 tries to text me it still sends the message as an iMessage and I NEVER receive the text on my Galaxy S3. It still shows the little blue bubble next to my name when starting a new text thread. So I checked with about 4 other iPhone users that text me on a regular basis and I'm not receiving any of their messages either.
    If the iPhone users turn off iMessage the text comes right through. However I dont expect all the iPhone users on my contact list to turn off the iMessage feature just so they can text me.
    I no longer have my old iPhone. I traded it in at Best Buy so there's no way of going back in the phone to change any settings. The iPhone was wiped of all data and settings anyway before I traded it in.
    I took my wifes iPhone and deleted my contact. Then I added it back. Still shows my name as iMessage. I took my e-mail address out of my contact entry on her phone and it still shows my name as iMessage.
    I logged into "Apple Support - My Support Profile" to try to unregister my device as suggested in another forum but I can't get past the "enter your purchase date" page. It was a refurbished iPhone and the date I purchased the device didn't work. Theres no way I'll ever get the original purchase date since I wasn't the original buyer of that iPhone.
    Any suggestions?? This is an urgent matter as I NEED to receive text messages from my wife and other iPhone users. My wife is willing to turn off iMessage on her iPhone but I don't expect everyone else to.
    I need to find out how to unreigster my old iPhone completely from iMessage.... or find out how to disable a specific contact on my wife's iPhone from using iMessage.

    If you still have an iPhone handy and have the SIM card you used for the phone, then temporarily put your SIM into the other phone and go into Settings and turn of iMessage. If not, the only alternative that I know of is the Support profile, However, you may what to search the More Like This section on the right side of the thread to see if any of the entries there have a green checkmark meaning they are answered.

  • How to disable automatic launch of WIE in startup configurat​ion with no options to do so?

    Thinkpad T400 2764CTO running Windows 7 Home Premium 64
    PC only 2 weeks old, very little on it, but getting slower and slower. Finally found the configuration for the startup menu and disabled several things I knew I didn't want at startup. One problem that I can't seem to figure out, is how to disable Windows Internet Explorer from being launched at startup? I have tried disabling every Microsoft option, and it still launches. Is there a specific Lenovo option [that does not obviously have anything to to with WIE] in the startup menu that, if disabled, will stop the WIE browser from being launched? How do I know which options are not safe to disable when attempting to slim down startup configuration for faster/more reliable performance?
    Thanks,
    Ann

    Either I *completely* misread your instructions; that fix is major overkill for what I was trying to do; that fix does not apply to my problem; that fix is only for XP or Vista and not W7; or my PC is already so messed up (despite clean hardware diagnostics, no viruses, no malware, and it is only 2 weeks old), that it performed unexpected and unwanted actions when trying to use the Windows features on/off program control panel options.
    Opened Control Panel, went to Programs, and finally found the option on the left for turning Windows features on and off. Unchecked the box for IE8, which required a restart. The restart time was 4-5 times longer than usual, even when launching superfluous programs from the startup menu, since it had to "reconfigure Windows." After restarting, WIE did not automatically launch, and its toolbar icon was gone too. Tried to turn it back on like you said, which also required a restart, which didn't make sense to me, since I expected the browser to launch again following another extra long restart once the box was re-selected. Although, surprisingly, it didn't, so for a moment thought it had somehow worked. Then I realized that my WIE icon was still missing from the toolbar, so there was no way to launch it even if I wanted to. Went back into the Control panel and checked every Windows feature box possible; another extra-long restart; still no toolbar icon for WIE. Had to go into the computer files to find WIE so that I could create a desktop shortcut icon so I could manually launch the browser from that. However, when I clicked on the shortcut, it went into a browser setup mode, as if it was being set up for the first time. Finished setup and tried to go to a webpage, but kept getting a connection error.
    Diagnosed it, and it said that the Local Area Connection had no valid IP address. Waited on hold with Mediacom for a hour before being disconnected, trying to find out what the IP address was and where to re-enter it, since unchecking the IE8 box in the Windows features part of the Control Panel, doesn't just temporarily disable the function, but apparently actually deletes the toolbar icon, as well as the IP address. Took several more attempts over several hours to get ahold of Mediacom reset the signal to get the IP address back and get back online. So that really does not seem like a viable solution for trying to save time and resources by removing something from the startup menu, if it just quadruples startup time, deletes WIE toolbar icon and IP address permanently, requires creating a desktop shortcut, and then requires several more hours on phone with ISP for signal reset to get the IP address back. Would have been much faster and done less apparent damage than just going ahead and letting it launch at startup and then just closing it. *sigh*
    I know that just having an icon in the toolbar does not mean that that particular program will launch at startup, as I have several others that have toolbar icons that I have been able to uncheck in the startup menu, so I can use the toolbar icons to launch each program manually. There just doesn't seem to be any program active in the startup menu that would be launching the browser, and still concerned about unchecking something necessary in startup that could screw it up even more.
    Is there any way to get my toolbar WIE icon back without a full system restore, so that I have less shortcut clutter on my desktop?

  • SaaS Sharepoint, ADFS claims and internal AD-CA: How to disable CRL check in Sharepoint?

    Hi all,
    We have an external SaaS provider with a Sharepoint 2010 server. In our AD, there is an ADFS server providing ADFS claims to Sharepoint and thus giving SSO functionality. For the ADFS service and its token-signing and encrypting, there is one certificate
    drawn from an internal AD Enterprise CA server.
    The problem is that, when the company user opens the Sharepoint URL, it is extreamly slow to open, however it does eventualy open. The SaaS provider has indicated its an issue with the CRL checking. I know on other Microsoft products there are ways to disable
    CRL checking but haven't found such information for sharepoint.
    We have provided the CRL files and the provider has added these and for as long as they are valid things work as expected. However the CRL then expires and we are back to square one.
    Can anyone help?
    I have found this question has been asked before here:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/431bae5c-c502-4723-9de7-663abd46658e/saas-sharepoint-adfs-claims-and-internal-adca-how-to-disable-crl-check-in-sharepoint?forum=sharepointgeneralprevious
    Unfortunately the answer doesn't satisfy my situation. Also not sure I agree that self signed certificates should be used and it's quite a topic for debate in ADFS circles... However in my situation we don't have the option to change ADFS to use self signed
    certificates as the ADFS service is in use with 12+ other service providers all who have no issue using the Token Signing Certificate even though they cant access the CRL either.
    Thanks for your help,
    James

    Hi,
    As I understand, you want to disable CRL check in SharePoint.
    There are four workarounds:
    1. Give your servers an outbound Internet connection
    2. Edit the hosts file at “%SYSTEMROOT%\\System32\\drivers\\etc\\hosts” to fool the CRL check into thinking your local machine is crl.microsoft.com by pointing it at 127.0.0.1 (localhost).
    3. Edit the registry to disable CRL checking by setting the State DWORD to 146944 decimal (SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WinTrust\\Trust Providers\\Software Publishing for both HKEY_USERS\\.DEFAULT and HKEY_CURRENT_USER) PowerShell.
    4. Edit the machine.configs and disable it there.
    The article gives you the details about the four workaround.
    More reference:
    http://basementjack.com/uncategorized/powershell-script-to-disable-certificate-revocation-list-crl/
    https://kb4sp.wordpress.com/2013/10/08/certificate-revocation-list-disable-check/
    Best regards,
    Sara Fan

  • How to disable the vibration feature for the Alarm?

    How to disable the vibration feature for the Alarm?

    Hi guys , because we have no answer to our issue how to take off the vibration when alarm is on , and our other profiles like ringtones, messages , reminders and so on we need to keep them on vibrate mode , the best solution is to install a free application from store called "alarmed " ; I did put it down on my phone and now i can use the alarm clock without any vibration at all ! That's the answer to our issue , before Apple is going to find a solution !
    Personally , I don't think is going to be fix it soon , as long as the apple script made for pop ups is general one !
    Good luck everyone

  • I have changed the apple ID (email, but on my iphone , the icloud is stil asking me to log in whit the old email.And it is poping-up on every 10 seconds.I never used icloud, and i dont want to use it.I just dont know how to disable the icloud.

    i have changed the apple ID (email) but on my iphone , the icloud is stil asking me to log in whit the old email.And it is poping-up on every 10 seconds.I never used icloud, and i dont want to use it.I just dont know how to disable the icloud.

    If you see that pop up you enabled icloud. Whether you want or do not want now to use it irrelevant until you actually disable activation lock.
    In order to do that you have to change your apple id back to do that just long enough to sign in and back out. System will ask you to verify, don't.
    Just sign in on the prompt you getting and then logout. Once done, change apple id to what you have now and verify. Then decide if you want to
    use icloud (who does not want to be able to track their phone if lost or stolen).

  • HOW TO DISABLE THE VIEW OF CONTACT

    Hi
    I want to know how to disable contact view from a friend taking my phone
    exemple : If I give my cell phone blackberry 9900 to a friend for 1 day, I want for him the possibility to answer phone call and see who is calling him ! ,
    buy I want to disable any search in full contact list
    how to do this ?
    help,
    mail me back

    You cannot selectively lock the address book app. If all contacts are sync'd online you can delete the account. However, the all around better approach would be to backup the device and do a security wipe before loaning it.
    - Ira

  • How to Disable Event firing while updating a list item using poweshell

    Hi All,
    I am working on a powershell code which updates most of the list items in the entire web application. I am using SystemUpdate($false) to update the items so that 'modified' and 'modified By' and versions are not changed.
    However event receivers gets fired which is now a problem. I want to disable the Event receivers before update and enable it after update. I want powershell code for this. I am using SharePoint 2010.
    Your help would be much appreciated. Thank you in anticipation.
    Regards
    Karthik R.

    hi
    check this thread:
    How to disable event firing outside an event. It contains example on C#, but it is not difficult to convert it to PowerShell.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • How to disable sessions in CS6?

    InDesign Server CS6 added a mechanic of multi-threading jobs via sessions.
    Now you can begin session and end session via SOAP web service call.
    However, the sessions add a huge overhead for those who want to use multi-instance instead of multi-threading.
    A webservice call without a session ID is always ~500ms slower while it creates a session in the background. The session is then appears to be used on a ~5 second sliding timeout allowing subsequent calls to be 500ms faster, however if you wait around 10 seconds, the next call recreates the session and increases render time by ~500ms again.
    This is a major issue when rendering takes on average of 1000ms. That's a 50% longer execution time. This is a major problem when trying to offer a speedy web application built on top of IDS.
    I tried creating sessions and keeping the IDs in memory, but they expire and result in a whole bunch of SOAP errors.
    My question is: Is it possible to disable sessions in IDS CS6 or remove the session expiration time completely?

    This is the other discussion: http://forums.adobe.com/message/4518765#4518765
    I've tried to lower the quality, and with pure magic, it now works, even when I put highest quality. I don't understand what happened. I asked you how to disable openGL because they told me to in the last discussion. So, thank you for repairing my problem (I think you repaired it, i'll make tests to see). Just in case, could you verify if it's posible to disable openGL like the other person told me?

Maybe you are looking for

  • Crystal report error in SAP

    I have linked my first Crystal report into SAP (2007A), but when I try to run it I get an error.  Msg header "SAP Crystal AddOn"....Could not load file or assembly 'CrystalDecisions.Windows.Forms, Version = 12.0.2000.0, Culture=neutral, PublicKeyToke

  • Oracle OpenSSO Pattern Matching for Application Express "Free" Pages

    Has anyone successfully established a "Free" page within an Application Express application under Oracle's OpenSSO? The problem seems to be associated with the use of wildcards and the f?p syntax. In addition, the use of wildcards and multi-level wil

  • Duplicates in my music library

    I have a playlist for my songs in the I-Phone 4. My problem is that i have duplicates of the songs. But my playlist and i-tunes are syncing, just that when i browse the songs through the phone's library i have 3 copies of each songs. When i checked t

  • Unable to buy exportpdf

    This is EXTREMELY frustrating. I want to buy exportPDF.  I have credit card in hand.  I'm ready to part with money.  But every time I try to subscribe I'm directed to the French login screen and there's no way to change country.  The address on my cr

  • JSP drop down problem; iam confused

    Hi All, can anybody help me out in creating this jsp page. Iam confused what to do and where to start building this page. Here is what i need to do : This new page will have two list boxes side by side and will have two arrows in between. In the left