Updating - the best of both worlds

Hi,
Ive had a look through a lot of the topics in this forum, though nobody seems to have wanted to do exactly the same as me.
My application has quite a few lengthy operations that are perfomed as part of an actionPerformed event. Im focusing on one particular event at the moment, but it will apply through my app (in about 8 places) so i need to get it right!!
If I dont put these methods in their own thread they will display their results after the operation, which is only a problem in that the app looks like its crashed (ie there is no update). So i placed them in their own thread, however this means that the user can keep starting these threads which causes massive headaches!!
What i actually want to do is suspend the event queue, until the operation is complete, but still update the windows, so the user can see that something is happening. In effect I want the effect of not putting the operation in a seperate thread (suspending the event queue), with the effect of doing this (a nice updated window).
Anybody know a way around this.
Steve

private boolean wait = false;
public void waitForSomeOperationToBeDone() {
   synchronized(getTreeLock()) {
       wait = true;
       while(wait) {
          try {
             getTreeLock().wait();
          } catch(Exception e) {
              break;
public void awake() {
   wait = false;
   synchronized(getTreeLock()) {
       getTreeLock().notifyAll();
}This usually does the trick for me, but it can fail sometimes. Try it...
It worked for me when I made a modal JWindow.
Nille

Similar Messages

  • CSS/jQuery Framwork: the best of both worlds..

    Well, today I decided to play with creating a CSS framework using JQuery in an effort to avoid, from the beginning, having to compensate for any of the various bugs in IE that happen when using either Absolute or floats in positioning.
    As I am working for a large corporation, we have to cater to IE 6, 7 and fringe 8 as well as Safari and Firefox both on the Mac and Windows.
    So far, I have tested successfully on both platforms and in all those major browsers and I've put together the best of Absolute positioning (precise placement by coordiates) and floated elements, which allow for document flow to expand as needed and yet maintain the placement of absolutely placed divs.
    No actual positioning is given in the css or jquery. The utility .position in jquery references other elements/divs/etc on the page as a base without resorting to using 'relative' on any element.
    The idea is this:
    A wrapper contains any 'absolutely' positioned divs. Those divs are placed in relation to that wrapper's top left corner using jquery. In the document flow, that wrapper appears after, say, a few paragraphs and is followed by say, more paragraphs/content. Since no "relative" declaration is used on the wrapper and no 'absolute' on the children, should any new content be added before that wrapper div (which doesn't have relative declared) the wrapper will move down accordingly taking with it the 'absolutely' positioned divs inside.
    Now, the trick to making this work was using one line of jquery to dynamically find the height of the largest/tallest div within the wrapper div and then dynamically set the height of the wrapper div to that number. The wrapper div could have some bottom padding or better yet, the last element within one of the 'absolutely' placed div could have a class that added some bottom margin should space be needed.
    So, once you have it set up, more content can be added and the expansion will happen based on content. This means no dealing with double-margin bugs, peek-a-boo bugs, 3 pixel jogs etc, etc. And, no conditionals need be used nor underscore hacks and the like to make things work in IE 6.
    I'll post some files as an example once the attachment option is back on.
    Just wanted to share this experiment and idea. I'll be posting it elsewhere but will return here once functionality of the attachment is back up.

    As BemDesign pointed out, the corporate (read bigger) world of commerce and finance depends on so many different variables than a small mom and pops shop or even a mid-size company like any given record label deal with that developer skills need to be fully encompassing... not just knowing the latest tricks and thinking that anybody using the net is using (at the moment) the latest Safari, specifically on the Mac.
    I'm really glad I had to delve out of the ad world of cool motion graphics and niche sites to a more global market because as other companies grow, they are relying on markets, not technology, to boom their business. That being understood, it's about knowing a target audience and how to reach them no matter how old/out dated their tech may be.
    However, I will relish the day when HTML emails have gone by-by and browsers automatically update themselves (let all the privacy and security gripes cease.. don't put information you don't want shared on the net)
    So, I hear ya about losing that 8.3% of IE6... but let's go for broke and say forget IE altogether and choose Firefox or Safari.

  • I've recently been given a macbook pro from uni, with lots of adobe software on. I want to pair it with my iMac which has music etc and is it possible to get the software to the imac and the files to the macbook?Giving me the best of both :-)

    I've recently been given a macbook pro from uni, with lots of adobe software on. I want to pair it with my iMac which has music etc and is it possible to get the software to the imac and the files to the macbook?Giving me the best of both :-)

    You would need the original installation disks or files for the Adobe software to get it onto your iMac, and having it on two computers may not be allowed by your university's licensing. Talk to whoever issued the MacBook.
    As to the music, just copy it over to the MacBook, either via Home Sharing, file sharing, or an external storage medium (hard drive, USB flash drive, etc.).
    Regards.

  • Linux on an iMac, best of both Worlds?

    Is anyone using Linux on their Apple, or has anyone tried it? One of my kids uses Linux and she swears by it. Reading the specs this looks like it just might be the best of all worlds.
    The Linux OS S.U.S.E Linux Desktop 10 is supposed to come out Monday in a free trialware form.
    Does anyone have previous experience running Linux on their Apples?
    Thanks,
    Doug

    I haven't tried SUSE Linux and I agree that Linux in general has come a long way in terms of useability but I still find it too frustrating to use regularly (you may be different) whether it be from lack of driver support or just trying to find the right tool to do what I want to do (Linux tends to give you a lot more which can be a blessing and a curse). For that reason, I prefer to try various flavours of Linux in a virtual machine. I have also tried an older version of Linspire which was a far better experience for me but not enough to use regularly. Essentially, it is still more of a 'geek' computer system than not and requires more effort than I'm willing to put out at this point.
    Yellow Dog Linux on PowerPC offered the best overall experience to me most likely as they were building it to run (for the most part) on Apple hardware. That resulted in less frustration than usual. With the move to Intel, perhaps there will be a bigger pool of developers looking to take advantage of Apple hardware but that remains to be seen.
    I suppose I've also grown so use to the relative sleekness, functionality and ease of use of Mac OS X that I can't imagine installing Linux on my iMac (short of in a VM). The same goes for Windows. Everything on my iMac CD just works and I don't know which of its technologies (i.e. bluetooth, iSight camera, video card, airport wireless etc...) are even supported in Linux without having to spend time searching for and downloading (if possible) drivers, hacks etc...
    So, at the moment, when I do try a new distro of Linux, it is usually in a VM or on older PPC or on a older, formerly Windows PC. I don't want to discourage anyone from trying Linux - on the contrary, I think it's beneficial to try out and learn about as many systems as possible. But from my experience with it, the user must be more prepared and willing to put out more effort to makes things work than is the usual case with OS X.

  • Swiftweasel -- best of both worlds?

    I just downloaded (via aur) the swiftweael package. Now this includes both icecat's (formerly iceweasel) and swiftfox's improvements. How cool! Comments?

    I currently use swiftfox, and I like it a lot, both because it at least _feels_ faster, and also because "Bon Echo" is just too ugly to live, both the name and the logo. Okay, I know that I could use firefox-branded from the AUR*, or just do some sed and cp to change these things, but that's also ugly (Why don't we make an Arch branded firefox, with a nice name ("Archfox" ) and a nice logo?)
    I am (very slowly...) looking for a replacement for swiftfox, both due to the swiftfox licensing and also since the, er, swiftfox developer sometimes is too slow with updates for my taste. I found swiftweasel some month(s?) ago, and had a look at it. At the time the swiftweasel-pentium-4 and swiftweasel-pentium-m (these are the ones I would use) were orphaned and stranded at version 2.0.0.7. These PKGBUILDs do some really odd stuff to the start script, the $HOME/.mozilla/firefox settings are copied to a swiftweasel specific directory, so that firefox and swiftweasel have separate settings. Seems pretty useless IMO. The two swiftweasel builds that are up to date, swiftweasel-athlon-xp and swiftweasel-pentium-3 don't do this, so it wouldn't take much work to copy those PKGBUILDs and use them (I think, anyway...). gothicknight, who maintains some of the swiftfox PKGBUILDs, adopted some of the orphaned swiftweasel PKGBUILDs some time ago (including those I would use if they were up to date), and I'm eagerly waiting for some news there But, until then I'll continue to use swiftfox.
    * I _have_ used it when swiftfox lagged with a security update for some week(s), but even I feel that a nice name and logo is only worth so much compilation time
    Last edited by Bebo (2007-12-30 21:10:18)

  • What's the best driver for World in Conflict? NX8800GT T2D512E OC.

    I have 169.21. Is the 163.71 optimized for WiC? Thaks.

    Well check Release Notes of the Forceware to findout. With both drivers version listed above should be fine.
    The most important part is to use latest patch for WiC.

  • Best of Both Worlds

    Hi Gang, Finally got fed up with HP, Dell, Acer, Gateway and bit the bullet and spent a little extra and bought this 13" inch mac book pro, added more ram and also added a ssd drive, very nice... fast, cool quiet, great battery life. Yesterday I felt brave and loaded a full 32 bit full version of Vista on Boot camp, I was amazed how easy the process was. after all the drivers where loaded, I noticed the sound (speakers) sounded a little weak so I loaded the OS X installation disk again still pretty weak sound??? Any help would be appreciated. Also it seems the machine runs hotter using Vista and uses a lot more juice ( That's Vista for you). Very pleased with the over all performance of this little giant..

    I am Bootcamping with RTM Win7 Ultimate. I will go to that partition and see how my speakers are working. I recently set the partition up and have not had time to do much with it, including listen to it:)
    I too have sworn off of PC's unless I can find one where the support is not outsourced. The Dell XPS lines at least used to not be outsourced. Don't get me wrong; I like all my PC's and especially RTM Win7, but I had a recent too-much-to-bear outsourced support problem on my HP laptop, and, as said, swore off of PC's unless .... I did get my problem solved perfectly eventually, but rather than go that route, I rather slit my throat.
    Message was edited by: donv (The Ghost)
    Message was edited by: donv (The Ghost)

  • I can't use airplay from iphone/ipad when I update the system

    It has been showed that "an error occurred loading this content, try again later".
    how can i fix that?
    and why apple TV can't output the sound to the AirPort Express on wifi? only airpay????
    so stupid...

    Actually, there is a solution, and it sounds to go against what you want until you realize how well it works.
    Seperate Apple IDs is the solution, but you can granularly sign into different things with different IDs.  Now, I'm in the exact same situation as you and saw the exact same problem.  Here was our solution:
    1) Create new Apple IDs for everyone that didn't already have one.  This meant my wife and daughter needed new IDs.
    2) Go into Settings -> Message and select "Receive At..."
    3) Change the Apple ID in iMessage on a per-device basis to the new ID for who ever owns that device.  For example, the new ID for my wife went on her phone, same with my daughter.
    Apple IDs are free, and you don't have to change the ID on every part of your phone.  For example, we still have the generic family ID on iCloud and the store, but we have our own unique ones signed in on iMessage and Game Center.  From what I can tell, this is the best of both worlds.

  • What is the BEST WAY TO ARCHIVE OLD PROJECTS and related media?

    Hi,
    I've been running a Wedding Film-making business for the last 12 months full-time. In that time I've acquired about 4TB of Hard Drive space, but as I get more work coming in the door I'm starting to need to get rid of old Weddings and Corporates I've shot.
    In the past - ie. at my old employers - I've archived the tapes in a storage room, and deleted all the captured footage. Then I'd burn the project file to a DVD or BLU-RAY depending on the job.
    Now that everything is Digital, is there a good way to archive the footage without buying a million TB's of Hard Drive space (then considering keeping multiple copies for safety)???
    I'm not concerned about needing to return to make changes to the projects at a later stage - these Weddings are locked and will never be changed.
    Any help, suggestions, or an example of what you do would be greatly appreciated!
    Thanks,
    Thomas

    Well that depends, if you only keep the exported copy and not the raw footage then if someone request some sort of edit change you'd be screwed if you didn't keep all the raw footage and simply kept the exported copy. However if you know that they aren't going to request some sort of change or you let them know up front they won't be able to make anymore changes after a certian point.(For exampel after you give the finished product and it's been approved by them) you can save TONS of space by simply only archiving the exported copy for them incase they need to make them another copy for some reason.
    Where I work we always backup EVERYTHING, because we have had clients call back and request raw footage (meaning un-edited footage) almost 2 years after they filmed before. So if  this happens to you will probably be happy you didn't keep only a exported edited copy and that you held on to all your source media. So really unless you're just 100 percent positive that this won't ever happen or it just hasn't happened to you as of yet then you can just export the project from premiere and keep only that.
    Blu-rays are a good backup option overall and like you mentioned for the amount of space you're currently using it won't be very expensive to just use hard disk. Just remember that you'll need to hook the HD's up at least 1 time per month. The reason is that it's good for them to spin every once in awhile. However in all honesty if you go with a RAID 1 setup or just simply buy two disk you won't run into to many occaisions where both disk fail at once... It hasn't ever happned to me at my job or in my personal business.
    One option though that in some ways would give you the best of both worlds would be to use the project mananger feature in Premiere to save everything that is in your timeline to a project folder. (It basically saves all your footage that's in your time-line. It excludes un-used things from the bin unelss you say different) Anyways it will save you space in the end while still saving the entire project to a single folder of your chosing. Then you could export your finished program from Premiere and then burn your disc from the finished file you got and only backup your finished file to say a blu-ray disc and then backup your finished file and your saved project to your hard disc you have to archive stuff on. What used to be 150GB would now probably only be like 25-40GB max. But like I said if someone requested a major change and not something minor you'd be out in the cold... I don't use encore much though so someone else would have to answer your question about backing up a encore project... But I'd assume if you had the backed up premiere exported digital file you could just import it into encore and be ready to roll so you wouldn't really need to backup the encore project unless you make a crazy cool customized menu or something. Then if someone needed only a minor change such as graphics or something you could use your backed up project folder from premiere to make the change and then send it to encore to re-export the product with the requested minor changes.
    It all really comes down to what you want to do. I'd recommend at the very least you backup your premiere project the way I described and also save the exported copy of your final project.

  • BRING BACK THE BEST EVER!

    I don't understand WHY Adobe would buy the bestever software
    and NOT USE it?!
    FreeHand had Layers BEFORE Photoshop and many others!!
    It also had Style Sheets, Superior Tools, and multiple pages
    which Illustrator still doesn't have!!??
    PLEASE BRING BACK FREEHAND, I'M SUFFERING THROUGH

    You guys have to remember that its only been a few years
    since Macromedia changed hands to Adobe. I've been a user of FH
    since it was Aldus FH in the late 80's and AI since 3.0 and have
    seen them both grow just like any other software and every time
    they changed hands they got better because of software
    integrations.
    You dont' buysoemthing becasue you want tothrow it away
    youwant touse it to your advantage Adobe is big and not because
    they go around killing other companies.
    I beleive AI has many new features that resemble FH but the
    multi page is a big pain in the bahooky I agree and the drawing
    tools well like using a swiss army knife and one tool needs to be
    put away before the next can come out. FH still has alot of cons
    which leads me to believe that they are not done with AI and things
    will change. How else do you think they will sell the new CS4.
    Look at Image Ready, Adobe gave that the boot and I thought
    it was pretty bad *** but when I saw why and took a look at
    Fireworks I said well looky there and well with whole Dream Weaver
    working practically seamlessly with PS, I just had to switch from
    MS Expression Web to Adobe Web Premium. I've been using MSFP since
    98 and switched to MSEW and well I'll leave that nightmare of a
    quagmire alone.
    I think Adobe has made a great effort to keep Macromedia's
    strengths alive Like Flash and how they integrated PSDs and AI
    files dynamically and well not to mention the After Effects
    workflow with Flash and heaven almighty I almost forgot how Encore
    can output a completed DVD and all of the menus to a flash SWF file
    crack-a-laken I say.
    I know it sounds like I'm cheerleading but I am not they did
    a good thing. I have always been a proponent of Macromedia but when
    you look at the big picture Adobe truley has gone the distance with
    the Macormedia products.
    I am still holding out for all of the FH cons to be added to
    AI. I mean how else do think they are going to get us to upgrade to
    AI CS4 or what ever they call it.
    I still use FH11 and it works fantastical and will probably
    never uninstall it less AI becomes Adobe Free Hand Illustrator and
    I mean truley the best of both.
    I think it will happen they'ld be stupid not to. Cha-Ching!

  • I have a iPhone 3GS and my husband has the iPhone 4 , both phones with updated current . We added iMessage to them at first it was great, now I don't get half the texts my husbands send and when I send him a text message it will come up from my email???

    I have a iPhone 3GS and my husband has an iPhone 4, both phones are updated. We added iMessage the them both and at first it was great, the messages appear in the text messages under the phone contacts and when I send a text message it will either be a green message  or a blue one for (iMessage) depending on the signal.  Now when my husband sends a text message to me I don't get them all or some days none. When I send him a text message he gets them from my email address. I cannot send him a standard text anymore my phone only wants to iMessage, so if the signal is not right it just sits there undelivered???
    I also have a friend who that we regularly texted each other, for the past 4 months I can receive her texts but she never gets mine? And I have tried countless times, now iv given up trying and I don't use texting to either, but everyone else no problem.

    You and your husband can share a store account and still have seperate iCloud accounts for your contacts, bookmarks and stuff like that.  Click here for instructions to make an apple account without entering a credit card.  Make sure you use a different email address for each apple account. 
    Set up your iPhone/iPad whatever using the new account for iCloud.  Then go into settings/store and sign in with your purchasing account, you may need to sign out of the other account.  To the best of my knowledge, your household is allowed to share purchased legally, someone please correct me if I'm wrong.
    Once you each have your own devices set to your own accounts you can set them to backup to that account and it will keep all your contacts seperate.

  • Which Tiger update version is the best?

    Have installed the original Tiger 10.4 on my Sawtooth 400mHz. Need to do a software update, but not sure which of the updates (from 10.4.1 to 10.4.11) is the best one to use without having any headaches. I have not installed any other software on the Mac yet (plan on installing Microsoft Office X and iWork 06 for example) until it's updated a bit. Haven't even hooked up a printer to it yet. The iWork 06 program says that you need at least 10.4.3. I've heard 10.4.7 and possibly the last update (10.4.11) have given problems.
    Any suggestions and advice is greatly appreciated!
    silverado93

    In Applications>Utilities, launch Disk Utility, that will allow you to Verfy & Repair Permissions both, but if the Verify says there's a problem, then you must boot from the Install Disk...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Yes, I'd do it in one swoop, far less to go wrong!

  • Whats the best way to check table before form deletion or update ?

    Hi, I have a func_staff table made up of a composite key - func_no and staff_id. I have a form where the datablock references this table.
    I need to be able to check that before a func_no and staff_id combination on the form are written to the database that that combination does not already exist in the table.
    What would be the code for that ? I've tried stuff like IF EXIST statements and even a select statement but I totally worded it it wrongly.
    To DELETE an entry in that same table, would the best way to be create an LOV for both func_no and staff_id, the problem with that would be if a user selected a combination that does not exist ? Could I create a combined LOV that would populate each field ?? (this way I could be 100% sure that the selected combination is valid)
    Thanks Peeps.

    hi,
    you can try and use the count(*), before deleting and updating
    lets say
    select count(*)
    into l_count
    from table_name
    where column1 = :block.column1
    and column2 = :block.column2;
    if l_count <> 1
    then
    insert into..........
    else
    show error message;
    raise form trigger failure;
    end if;
    similarly u can use l_count before deleting.
    regards,
    Mayank

  • What is the best way to update the delivery time?

    Hi All,
    One of the tasks I have in my job is to updste purchase orders with information found in the orderconfirmation we receive. In the order screen, ME22N, you can change the date in the item, where you have all positions listed. But you can also change it in the tab classifications.
    What is the best way to update the delivery time?
    Best Regards
    Praveen

    Hi
    It may userfull to you
    If you change the delivery date after you have send the PO, then the statistical delivery date is still containing the old delivery date., as long the order is not send this date is changed together with the delivery date.
    Vendor evaluation is performed based on statistical delivery date.
    So if you are responsible for a date change, then you change both dates, that the vendor does not get bad points. but if the vendor cannot deliver at the wished dates, then you change the delivery date only, that all people in your company and MRP run can rely on the new delivery date, but your vendor is evaluated against the old date, because of his fault.
    regards
    Madhu

  • What is the best strategy to use both Z10 and Q10?

    Assume I have both a Z10 and Q10 and I'd like to use it on alternate days, what's the best strategy to do so?
    BBM should be fine with the same BlackBerry ID and it can just keep switching between the 2 devices.
    If I am using local contacts and calendars, is there an easy switch to keep them sync on both Z10 and Q10?
    There are also other information to sync in Password Keeper, Remember...etc.
    Is there a solution?

    Hello,
    For calendar and contacts, there is this:
    http://supportforums.blackberry.com/t5/BlackBerry-Q10/How-To-OTA-Sync-BB10-and-non-BES-Outlook-Overv...
    With that, I actually keep all of the following in sync:
    Two instances of Desktop Outlook (2007 and 2010)
    Z10
    PlayBook
    Outlook.com
    And, before I decommissioned it, also an Android device. Any device that can synchronize with Outlook.com can use this solution to keep in sync for calendar and contacts. You, of course, need to not use solely local contacts and calendar but instead keep them synchronizing with Outlook.com.
    For the other things you mention, I know of no solutions other than backup/restore...but I do not recall if LINK offers the selective method for those.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for