Do I use SwingUtil.invokeAndWait/Later for programmatically clicking mouse?

If I have some code that moves the mouse over a component and then clicks it, do I need to execute that code in SwingUtilities.invokeAndWait or invokeLater? Right now, I'm executing that code in a new thread I created (actually in a ThreadWorker from a ThreadQueue). It works (but that's not a guarantee it'll always work). But I've seen the recommendation that you never do anything that can alter a swing component from any thread other than the EDT.
(From: http://mindprod.com/jgloss/swingthreads.html )
You can’t directly meddle with Swing components, or their backing data models from a second thread. The
contract is, if you want to do anything to a Swing component that could have any effect on it’s display from an
application thread you should add it to the event dispatch thread’s queue via SwingUtilities.invokeLater( Runnable )
or SwingUtilities.invokeAndWait( Runnable ) so that it will be done on the same thread that Swing itself uses. {/
quote}So what's the right way to do this?

What if the code creating it is called from a listener (e.g. ActionListener on a button)? i'd assume then it's running on EDT anyways, right?Right, but you do sometimes need invokeLater to allow the EDT to complete whatever it's doing before executing your code.
For example, when a menu action opens a modal dialog. Without invokeLater, the menu stays open till the dialog is closed.
db

Similar Messages

  • Using Front Row IR for Logitech infrared mouse?

    Hi,
    my mighty mouse felt, opened up and died. The wheel has gone for good (tried to clean it but this time no luck). So I have to resort to my old IR logitech mouse. Since to use the IR dongle is pretty annoying, is there any chance to connect it to the in-built IR used by Front Row? Thanks in advance.

    "I am at a loss and do not want to have to give up my macbook pro for a week to wait on them to repair/troubleshoot. Any thoughts?"
    Appears you have no choice if you want your computer IR repaired properly. If your computer is still under the 1 year warranty and/or you have AppleCare, you can always request for a replacement until your computer is repaired.

  • In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    Please don't post the same question multiple times!

  • When I use my Apple ID for the last 12 hours I get this response:  "There was an error in the App Store. Please try again later. (4)".   How do I get around this?  Try two apple ID's.  Same thing.

    When I use my Apple ID for the last 12 hours I get this response:  "There was an error in the App Store. Please try again later. (4)".   How do I get around this?  Try two apple ID's.  Same thing. 

    What does it mean when I get...: Apple Support Communities
    'there was an error in the App Store....: Apple Support Communities

  • Safari will no longer open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files.

    Safari will no longer open. It just goes back to my desktop.  When I right click on the safari icon in my dashboard it says it is open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files. Some of my emails from trusted sites won't open and does the same thing. 
    I upgraded my original system from 10.4.11 to I believe 10.6. something about a year or so ago.  I thought about re installing my safari app but when I go to open anything connected to safari my screen goes back to the desktop.  I cant open any files that I have on my desktop that I set up through safari, like my banking program. Prior to changing system preference to safari default I was able to open those files and now I can't get into change it back.  Can you guide me through this?
    Thanks,
    Betty

    Try running the 10.6.8 combo update.
    10.6.8 Combo Updater
    System Preferences or Safari Preferences?
    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.

  • Hi, we are using mac mini's for our developement purpose. connecting the same through using Real VNC. Mac mini's are late 2009 and 2010. Now we have upgraded them to 10.8.5. after upgrading having display issues after launching the simulators

    hi, we are using mac mini's for our developement purpose. connecting the same through using Real VNC. Mac mini's are late 2009 and 2010. Now we have upgraded them to 10.8.5. after upgrading having display issues after launching the simulators, we are unable to view the icons we need to move the simulator (into different places) to view the icons.
    Also we are having Mac book pro's (Late 2009 & 2010) after upgrading them to 10.8.5. Unable to launch the mac, getting only white screen with apple icon.
    Let me know is there any specific Hardware (Graphic Cards) we need to use for the same.
    Please provide me the early solutions.
    Regards,
    Suresh.

    Hi, try this first...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.

  • I have been using firefox aurora 7 for mac. Most of my handful of add-ons have been disabled -- including Read It Later and Feedly, which I was making good use of. Can you tell me when they will be enabled for firefox aurora 7?

    I have been using firefox aurora 7 for mac. Most of my handful of add-ons have been disabled -- including Read It Later and Feedly, which I was making good use of. Can you tell me when they will be enabled for firefox aurora 7? Maybe I should go back to firefox 6

    You can use the Tab key to select a search engine on the bottom bar and press Enter to use the search engine to do the search.
    *https://support.mozilla.org/kb/Search+bar
    In the current Firefox 34 release there is a new "one-off" search bar.
    This search bar doesn't show the name of the search engine and a logo.
    You can type one letter to make a drop-down list appear where you can see suggestions and see the used search engine and that also has bar at the bottom where you can select other search engines that are enabled via the Search tab in Options/Preferences.
    You can use the Tab key to select one of the other available search engines and press the Enter key to search with the selected search engine.
    Click the search engine icon and click "Change Search Settings" to open the Search tab in Options/Preferences (positioned between Tabs and Content) to select the default search engine and select which search engines to show in the search bar drop-down list that opens when you start typing search terms.

  • Can I use 27' iMac(Later 2009) as a display for Mac Pro(future 2013)?

    Can I use 27' iMac(Later 2009) as a display for Mac Pro(future 2013)?

    See > http://support.apple.com/kb/PH11302
    To be able to use the iMac as an external display, the Mac Pro should come with a Mini DisplayPort or Thunderbolt port, so think that it will include Mini DisplayPort or Thunderbolt, although we don't know anything.
    To connect the iMac to the Mac Pro, as your iMac has got a Mini DisplayPort, you have to use a Mini DisplayPort to Mini DisplayPort cable (Thunderbolt is compatible with Mini DisplayPort cables, but Mini DisplayPort isn't compatible with Thunderbolt cables). Then, just follow the steps of the page above to use the iMac as an external display

  • HT3924 Can I use my 27" late 2013 imac as an external display for a gaming console?

    If so, how would I set it up and how much would it cost me?

    No, sorry, you can't. Pre-Thunderbolt iMacs could to this, but with Thunderbolt-equpped iMacs they can only be used as a screen for other Thunderbolt-equipped computers. No company has yet to come up with a converter that works with Thunderbolt Macs. The only way you could get video from a game console into your Mac would be via a video capture device and the inherent lag in such capture would, I think, make most if not all games unplayable.
    Regards.

  • Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? Difference between Enterprise and SE?

    We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
    We have also reproduced the issue on the following stacks:
    Oracle SE One 11.2.0.3 (with Spatial enabled)
    Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
    Microsoft Windows Server 2003R2 Standard x64 Edition
    However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
    Any help or advice would be much appreciated.
    Kindest Regards,
    Kevin

    In my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
    BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late.

  • Performance degradation using Jolt ASP Connectivity for TUXEDO

    We have a customer that uses Jolt ASP Connectivity for TUXEDO and is suffering
    from a severe performance degradation over time.
    Initial response times are fine (1 s.), but they tend to increase to 3 minutes
    after some time (well, eh, a day or so).
    Data:
    - TUXEDO 7.1
    - Jolt 1.2.1
    - Relatively recent rolling patch installed (so no there are probably no JSH performance
    issues and memory leaks as fixed in earlier patches)
    The ULOG shows that during the night the JSH instances notice a timeout on behalf
    of the client connection and do a forced shutdown of the client:
    040911.csu013.cs.kadaster.nl!JSH.234333.1.-2: JOLT_CAT:1185: "INFO: Userid:
    [ZZ_Webpol], Clientid: [AP_WEBSRV3] timed out due to inactivity"
    040911.csu013.cs.kadaster.nl!JSH.234333.1.-2: JOLT_CAT:1198: "WARN: Forced
    shutdown of client; user name 'ZZ_Webpol'; client name 'AP_WEBSRV3'"
    This happens every 10 minutes as per configuration of the JSL (-T flag).
    The customer "solved" the problem for the time being by increasing the connection
    pool size on the IIS web server.
    However, they didn't find a "smoking gun" - no definite cause for the problem.
    So, it is debatable whether their "solution" suffices.
    It is my suspicion the problem might be located in the Jolt ASP classes running
    on the IIS.
    Maybe the connection pool somehow loses connections over time, causing subsequent
    users having to queue before they get served (although an exception should be
    raised if no connections are available).
    However, there's no documentation on the functioning of the connection pool for
    Jolt ASP.
    My questions:
    1) What's the algorithm used for managing connections with Jolt ASP for TUXEDO?
    2) If connections are terminated by a JSH, will a new connection be established
    from the web server automatically? (this is especially interesting, because the
    connection policy can be configured in the JSL CLOPT, but there's no info on how
    this should be handled/configured by Jolt ASP connectivity for TUXEDO)
    Regards,
    Winfried Scheulderman

    Hi,
    For ASP connectivity I would suggest looking at the .Net client facility provided in Tuxedo 9.1 and later.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Can I use SetFld during GenPrint for banner page fields?

    I have a banner page form that has multiple variable fields on it to display information specific to the batch it's being included with (for out post-composition handling area). I currently set those fields' values by assigning variables of the same name (as the fields) within a DAL script called as my BachBannerBeginScript for that batch. The fields on the Banner page form/section have a rule of NOOPFUNC, so without that assign process happening during the DAL script, they inherently hold no value. This has worked fine so far.
    Now I have a new banner page for a different process/batch, and it's purpose will be to be a "summary report" of sorts, detailing on the banner page high-level information about each document within that batch. I take information from the batch file (bch), read in an additional external file and aggregate the data in GVMs (to form an array, basically) during the BatchBannerBeginScript. The problem I now have is that I have a variable-sized array (based on the document-count within my batch file), yet my understanding is that I can't use functions available to me in GenData, so I have to basically pre-define as many instances of the section (if I do a report line per section) or field (if I do one section with all instances of the field on it) as I think are possible (max-case scenario, basically).
    However, after I have my Section/Fields defined, I still need to use DAL scripting to populate those fields. I tried to use SetFld to populate them, but the values don't show up in my output, leading me to believe that function/rule doesn't work in GenPrint. Is there a better way to set all those fields than to explicitly assign each instance of a field? I'd rather have a short While loop that takes a GVM's instance and assigns it to a variable field name than have hundreds of assign statements where I explicitly assign each possible field.
    Thanks,
    Gregg

    Aha. So you have an existing script that is executing somewhere to assign some other field during print. Depending upon what and when this script runs, you may be trying to set your banner fields too late. You see, as a default the banner page is temporary. Generally it is created, printed, then destroyed all before the first real page of your transaction prints. If you are not using the TransBannerBeginScript INI option as mentioned earlier, you might try to use that method to run your script which should be while the banner page is still alive.
    There is another way that you could try to run your script on the given page using what is called a "print time" or "macro" field. This would involve creating one more field on your banner section and name it like this:
    ~DALRUN MyScript.DAL
    Yes, you can name your script something other than MyScript.DAL.  The key is the ~DALRUN at the start, which will be interpreted at print time to mean that you want to run the DAL script and return a value. Now, of course you don't need a real value for this field, but there's nothing to stop the script from assigning data into the other fields at that time.
    You do have to make sure that this field is the first in sequence on the section. Otherwise, some of your fields may print before it gets to the point to evaluate this "print time" request.
    To make sure this is the first field in sequence will differ depending upon whether you are using DMStudio or the older Image Editor. Since you mentioned 11.5,  you could use either. In DMStudio, simply click on the "Objects" tab when the section is open and then click on the field to highlight it in the tree. Then use the button bar just above there to move the field to the top of the list.

  • Can we use xml Publisher reporting for sql* Plus in EBS

    Hello All,
    The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
    So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
    Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
    Thanks and Regards
    Balaji.

    Hi
    Thanks for the reply..
    I tried to do the follwoing
    1. changed the output to xml in the conc. prog.
    2. ran the same report but i am getting the follwoing error in the output file
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource
    Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
    So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
    if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
    thanks in advance
    Balaji.

  • Can i use a thunderbolt display for my macbook pro and hp laptop with windows 7 and what adapters will i need

    Can i use a thunderbolt display for my macbook pro and hp laptop with windows 7 and what adapters will i need

    Hi jayhrab,
    Currently, the system requirements listed for an Apple Thunderbolt Display are:
    Thunderbolt-enabled Mac computer, including MacBook Air, MacBook Pro, Mac mini, and iMac
    OS X v10.6.8 or later
    Apple - Thunderbolt Display - Read the tech specs.
    Regards,
    - Brenden

  • MDT Console with more then 15 machines, How to use the same drivers for more machines.

    Hello,
    I'm am looking for a solution to make our MDT design as effective as possible(as small as posible).
    The Situation:
    The company has more then 15 different computers added to the MDT console for the automated installation of Windows 7. The installations are done in 2 different ways, 1 with a local USB key installation (with the deployment folder on the USB key) and the other
    installation is a network USB key installation (with the deployment folder on the server).
    The local USB key exists for offices in parts of the world where the internet connection is poor.
    The problem:
    We have machines which can use the same driver for different kinds of hardware functions (LAN, WLAN, etc..)
    If we add a new machine to the MDT and we don't check the box for "Import drivers even if they are duplicates of an existing driver" we will automatic use the driver which already exists in the deployment folder. If say half a year
    later we stop using an older machine which "may" have drivers that are being used for other machines and we delete the machine from MDT we should
    NOT check the box "Completely delete these items, even if there are copies in other folders". The problem is that this can also lead to a lot of unused drivers in the deployment folder also because we do not know exactly how many
    computers are using a certain driver.
    At the moment we have another deployment share with for each machine its own drivers installed (so some drivers will be multiple times in the deployment folder) as you can guess this becomes really big.(deployment folder of more then 24 GB). The advantage
    of this is that we can delete a machine from the MDT list without having to worry if the drivers for that machine might be used by other machines. It is now just becoming to big in size(GB).
    The Question:
    Is there not an option within MDT that checks automatically if the drivers connected to a certain machine in MDT are being used by other machines? In this case we would check the box "Completely delete these items, even if there are copies in other folders"
    and MDT would not delete the drivers which are still used for the installations of other computers.
    Thanks in advance.
    Greets,
    Arie

    Arie,
    I think you are over-complicating this. Basically using drivers that already exist is the way to go. Otherwise drivers will be imported a second, third or fourth time. Which also takes up allot of disk space. If you're concerned about driver management,
    then I would suggest to drop your concerns, since there is nothing to less you can do about this particular issue. As long as you don't delete the driver that's been imported earlier by another machine there is nothing to worry.
    Ask yourself:
    - how long am I going to support model x
    - how many times do I want to update drivers
    With selection profiles you can easily target which content needs to go where (on your USB drive of-course)
    I can imagine that managing 25 shares for 25 different models, just because you 'refuse' to have old drivers in your share, or have removed support for some hardware models, isn't really time and energy efficient too.
    If you take a look in your deploymentshare\control folders you will see some XML files. These XML files hold all the entries in your deploymentshare. So your drivers.xml and drivergroups.xml (depending on the number of groups you have) are going to be very
    big XML files. These XML files are read by MDT to identify the objects in MDT and under which folder the objects are located.
    It's not possible to create or have an dependency between driver files and hardware models, other then creating groups under "Out-of-box Drivers" and using selection profiles.
    Another suggestion would be to decrease your number of hardware models drastically. On the other hand, having 25 Gb of offline media isn't really a big deal either. Portable and removable media of those sizes (32 and 64 Gb) isn't that expensive as it used
    to be 5 years ago.
    Don't get me wrong, I perfectly understand your desire to manage this, but MDT doesn't provide any other way, then the things I have pointed out to you here.
    Good luck! :)
    If this post is helpful please click "Mark for answer", thanks! Kind regards

Maybe you are looking for

  • Broken DVD Drive on my Satellite M35x laptop

    Hi, the CD-DVD Drive on my Satellite Laptop apparently is broken and I was thinking about purchasing an external CD-DVD Drive and would appreciate HELP. In the event that I need to RE-Install Windows, would I be able to do this with an External CD Dr

  • XML/AS3 Lightbox style gallery - need starting point....

    I've made a gallery slideshow before but wasn't as intuitive looking back at it now and I want to start fresh on this new project. I would like to convert a jQuery lightbox style gallery into a flash XML based AS3 image gallery with categories. I don

  • Art Board Ruler

    Can I see the Ruler in 64th inch instead of 8th inch?  When I change to 64th inch the ruler shows at 8th inch.

  • Opening microsoft excel files in numbers

    I received these document warnings when I opened my Numbers '09 version 2.3 file: Missing File - pct256.tiff Missing File - pct259.tiff Missing File - pct202.tiff Missing File - thumbs/proto-thumbail-Sums Checklist.tiff Missing File - pct508.tiff Mis

  • Code C0000135 Windows Update encountered an unknown error.

    While trying to install Windows 7 Service Pack 1 (KB976932) on a 32 bit system, I keep getting error code Code C0000135.