Best way to make EventDispatchThread wait for SwingWorker?

Hi ,
I have been scouring these forums looking for a simple solution, but can't find one. I want to use a SwingWorker to connect to a server an return some results, but I don't want the EventDispatchThread to continue on until the SwingWorker 's finished() method is done.
What is the easiest way to do this?
An example would be great!
Thanks
private void myMethod(){
     new SwingWorker(){
public Object construct(){
//connect to server
return null;
public void finished(){
//open window with results
}.start();
//Wait here until finished() completes.
}

Hi
I have a similar issue but in a different context.
In my application multiple tab pages are shown. There is an option to close All Tabs. When this is done, firstly it has to save the contents in both the tabs.Each tab contains a Report which contains multiple views.
For single Tab, the save operation is as follows.
1. Shows a JOptionPane to enter the Report name,
2. For each view present in report show a JOptionPane to enter the view name. (This is done on a different thread. (Not SwingWorker) )
For single Tab its fine.
If multiple tabs, then Firstly
1. JOptionPane to enter the Report name is shown.
2. Again the JOptionPane to enter the second Report name is shown. It should have been to complete saving of the first report with its views first then only it should start the second report.
I have a for loop . For each Tab i will be calling a save function. Save function firstly shows a JOptionPane to get the report name and new Thread is started which will save the complete view inside the report. I need this operation to complete first before proceeding with the next tab.
For loop is called from the EDT.
Any help on this?

Similar Messages

  • Best way to make program wait for input from NI USB 9162?

    Hi, I'm somewhat new to Labview, but through all the tutorials and online help I'm still having trouble getting this to function properly.
    The USB adapter is hooked up to a network cable split into single wires reading in a voltage coming through several seperate oscillators.  
    Testing in the lab, the program included below works fine when I run the program, then quickly administer a shock to the table.  In the real world scenario though, I'm trying to make the program wait to record data until the first shock reaches the first oscillator before recording data, but I just can't seem to find an easy way to make this work.
    Attatched is an example of the program.  Any help would be greatly appreciated.  Thank you. 
    Attachments:
    Acq&Graph Voltage-Int Clk-rh-tt-1.vi ‏56 KB

      Hi,
    I think I have the answer you're looking for! Please see the attached VI.
    I moved the graph indicator inside the "true" case of the case structure. Before, your VI was sending data  to the graph from an empty timestamp constant with each iteration of the "false" case. Now the VI only sends data to the graph if a true is read.
    If you're wondering why it takes a bit of time for your graph to stop updating before it stops writing new data, it's because you're filling up a buffer of sampled data by using a queue. If you're writing to the buffer faster than you're reading from the buffer, you may encounter an "overflow" situation when the queue gets full. To avoid this, you might consider using a notifier rather than a queue. It's the exact same thing as a queue, but it gives you only the most recent value, allowing new values to overwrite old values.
    Hope this helps.
    Regards,
    Dan Richards
    Certified LabVIEW Developer
    Attachments:
    producer consumer DAQmx threshold.vi ‏57 KB

  • The best way to make proxy files for editing?

    Hi,
    What is the best way to create proxy files for editing? I'm thinking Apple ProRes 422 (Proxy). The original material is DVCPRO HD 1080i50, shot on Panasonic P2 cards, and copied on to hard drives. But as there is about 400 hours of it, I desperately need to find a clever way to make smaller proxy files for editing.
    I would also like to make the proxies at a smaller resolution than 1080i for the editing process.
    I guess it's possible to import the media and then batch export it to the proxy format, but Is there a better way?

    I'm not able to ingest the material directly from the P2-folders as ProRes 422 (Proxy). No matter how much I change the import settings in "Log and transfer", it still ingests as DVCPRO HD 1080i50.
    Correct. DVCPRO HD P2 can only come in as DVCPRO HD. You can't transcode it. AVCIntra P2 is what you can bring in as ProRes. (Sorry Tom).
    I can of course transcode it form there to the proxy format and delete the ingested files,
    Why? Why do that? You have ingested all the files, right? You ALREADY HAVE THEM...right? Why not work with them? You obviously have the room (20TB). Why import all this, then now take the days it would require to make proxies?
    Making the ProRes-proxies directly from the P2-material seems more logical, or isn't it?
    DVCPRO HD P2 cannot come in as anything else, so the offline/online workflow for them doesn't work unless you import it all, then transcode to a smaller format...but then need to keep the originals online to relink to when you are done. If you wanted to do an offline/online, you needed to research this better...or test it...before you shot your hundreds of hours only to find that what you want to do won't work.
    Shane

  • Best way to make a slideshow for a wedding?

    I am trying to make a slideshow for a wedding. What is the best way to make this?

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    OT

  • Best way to make disk images for game disks?

    I want to play my beloved Battlefield 1942 on my Air... and I realized that I need the disk! ...Is there a way to turn the game disk into an image and "launch" it so the program thinks it's in the diskdrive, etc?
    I looked in DiskUtility, and I was a bit unsure what kind of image to make it.
    tia,
    e

    <font "size=+1">Duplicate a CD or DVD
    1. Insert the DVD/CD;
    2. Open Disk Utility, and select the DVD/CD from the left side list (select the DVD/CD icon on top);
    3. from the DU File menu select New | Disk Image from Disk 1;
    4. Choose to format the disk image as DVD/CD Master, name the disk image and click Save;
    5. When the .cdr file is finished select it with mouse and press COMMAND-I to open the Get Info and check the box to lock the file;
    6. Choose the .cdr file from the left side list, click Burn, and insert a new, blank DVD or CD.
    You can skip the last step if you don't want to burn the image to a CD or DVD. There is no guarantee this will work since many games will only work with a CD or DVD rather than a mounted image of one.

  • What is the best way to make a list of addresses for envelopes or labels?  Address book, numbers or pages?

    What is the best way to make a list of addresses for envelopes and labels?  Address book, Pages or Numbers?

    I liek your idea of having multiple images in a grid. I think
    that would be the best bet as you mentioned. Having one big picture
    would be hard to distinguish the sub-areas with mouse coordinates.
    I think checking the coordinates for the mouse would be very
    tedious because I would have to check for the left boundary, the
    right, top, and bottom for each sub-area!
    What do you mean by using button components and reskinning.
    Is this simply using buttons and changing the way they look? I'm
    just trying to save time and memory, because if I had a 10 by 10
    grid, thats a hundred buttons. Wouldn't that slow down the machine
    alot? And for that matter wouldn't having a grid of 10 by 10 images
    also by the same deal?
    Thanks for the input, I'm just trying to find the most
    efficient way to do it.

  • What is the best way to make PSD into HTML for emails

    What is the best way to make PSDs into HTML for emails? Will the new feature in Dreamweaver work for emails as well? I am using Cheetah mail, but I need to be able to turn PSDs into HTML so I can use it in Cheetah mail.  I have a general idea of how to do this, but I'm stumped about where to begin.

    Use PShop for images only.  Use DW to create your tables and inline CSS styles.
    Many e-mail clients do not show images for security reasons.  So graphics heavy e-mails are not an optimal way to communicate with your mailing list.
    See Alt-Web Articles, HTML E-mails and Newsletters
    Nancy O.

  • What is best way to make disk backup of CS5 downloaded installation?

    Hi,
    We purchased the downloadable version of the CS5 Production Premium installer rather than waiting 2 weeks to receive it in box form.
    What do you suggest is the best way to make a backup of the downloaded installers, which total about 13.8 gigs?  I was thinking of putting the main one on a dual layer DVD-R but the biggest file is 9.23 gb's, nearly a gig over the data limit for dual layer disks.  Is it possible to use Toast to split a disk image over multiple files or use Apple Disk Utility to compress the .dmg even further to fit?  Or perhaps is the easiest way to just copy it over to a USB thumb drive?
    I know Adobe allows you to re-download the software whenever needed, but it would be more handy for us to have a backup here rather than wait for another really long download...
    Suggestions?
    Thanks!

    You can buy a set of backup disks from Adobe for a nominal fee. You might want to give them a call and ask about it.
    Otherwise, just back it all up to an external drive.
    Bob

  • I am moving from PC to Mac.  My PC has two internal drives and I have a 3Tb external.  What is best way to move the data from the internal drives to Mac and the best way to make the external drive read write without losing data

    I am moving from PC to Mac.  My PC has two internal drives and I have a 3Tb external.  What is best way to move the data from the internal drives to Mac and the best way to make the external drive read write without losing data

    Paragon even has non-destriuctive conversion utility if you do want to change drive.
    Hard to imagine using 3TB that isn't NTFS. Mac uses GPT for default partition type as well as HFS+
    www.paragon-software.com
    Some general Apple Help www.apple.com/support/
    Also,
    Mac OS X Help
    http://www.apple.com/support/macbasics/
    Isolating Issues in Mac OS
    http://support.apple.com/kb/TS1388
    https://www.apple.com/support/osx/
    https://www.apple.com/support/quickassist/
    http://www.apple.com/support/mac101/help/
    http://www.apple.com/support/mac101/tour/
    Get Help with your Product
    http://docs.info.apple.com/article.html?artnum=304725
    Apple Mac App Store
    https://discussions.apple.com/community/mac_app_store/using_mac_apple_store
    How to Buy Mac OS X Mountain Lion/Lion
    http://www.apple.com/osx/how-to-upgrade/
    TimeMachine 101
    https://support.apple.com/kb/HT1427
    http://www.apple.com/support/timemachine
    Mac OS X Community
    https://discussions.apple.com/community/mac_os

  • What is the best way to make a DVD from iMovie

    What is the best way to make a DVD from iMovie?
    I am using iMovie 06 (Naturally) with iDVD 08. I have always used;
    iMovie 06, File > Share to iDVD 08. And got pretty good results.
    Some say the best way is to quit iMovie 06, open iDVD and import the movie from the Media button.
    I have tried both methods in the results look the same. I'm interested in getting the very best quality possible.

    You likely have one of the most expensive media converter boxes on the market today.
    But does it work well with most macs? (my guess is that it does). But more specifically can it "handshake" with an intel based mac? I personally haven't tried it.
    But you may want to read this for yourself if you haven't already:
    http://discussions.apple.com/thread.jspa?threadID=1179361&tstart=2362
    Assuming it works then the best format is .dv which this unit will support apparently.

  • Best way to create Math-Book for several devices

    Hello,
    I have written some Books about Mathematics and past months I rewrote the first one directly in iBooks Author - My original files have been written in WinWord 15 years ago, so there was only plain text, I could copy/paste into iBooks Author. The rest I had to edit completely new in LaTex in iBooks Author. Now I see it was the wrong way because it is pain in the *** to come back from ibook-Format to ePub and other formats to also sell them at Amazon for example.
    So I hope to get some Pro-Tips for the best base format for easiest export to all possible formats. Of course ibook has more possibilities, but it would be a way to have a base version as epub, pdf, etc and then import into iBooks Author to make an extended version with videos, etc.
    Would pages be the best way to make a base version (as far as I have seen there seems to bee a pay to export to ibooks Author and also to make ePub-version)? Or maybe making an HTML-Version with calibre (I think this is possible in calibre).
    Problem is simply that I have so much Mathematic expressions in my books and so I need LaTex for best presentation and design.
    Has anyone experience with creating Science Books?
    But second problem of course is still to find a way to get an ePub version of my ibooks-file. So far I did not find a way to export the book including LaTex source.
    I so much would appreciate some good advices on this...
    Thank you so much in advance!
    Bye
    rockie

    Hello RoberRM,
    I am sorry that I can not give you a convenient solution for our problem. I finally went the same path like with my first book: I mainly target at students with iPads, so I decided to get the best out of iBooks Author to get the full palette of features. I simply did not want to stumble into experiments with uncertain results.
    Maybe later on I will go the hard way to copy and paste text and latex part of the books into pages. I will see if it will be worth the efforts...
    Besides this the workflow in iBA is simply more effective and time saving. So, at the moment for me everything points into the iBooks Author direction.
    Maybe in later versions we will have ways to export into other formats.
    Bye and good luck with your work!!
    rockie

  • Best way to make a Constant Power Load

    What would be the best way to make a load that always draws the same amount of power whatever the voltage on it. For exemple, an load would draw 100 mA at 24 VDC, 150 mA at 18 VDC and 200 mA at 12 VDC. All I found is to use Nonlinear Dependant source.
    Any easier way to do this? Thanks.

    Sorry about the file mix up, I was anxious to get it posted for you that I failed to realize you were using a different version.
    As far as the last "amplifier" in your Leaky Feeder design, I actually hooked it up to the 24VDC supply on the left and this was a direct connect before the first resistor.  I realize this is not what would be ideal for your application as probably you have only a certain place in the Leaker Feeder to tap off from. I would suppose this would be going into a different entry way off the main entry at an intersection so I do not know how my adjusting the placing of this would effect the results because it seems to me by doing this I have bypassed a bunch resistance in the Feeder cable itself (if that is what the resistors represent) and also bypassed a number of amplification stages in the process as well.
    I will post a picture of my circuit for you to examine and try in Version 9.  This is the only thing I could come up with to where the power draw was the same no matter what the voltage input was. The only thing I can see as a drawback is that with this circuit the current remains constant but the voltage fluctuates. If I use a 24V regualtor and drop the input voltage to 12V the current remains at approx 118ma but the voltage drops to 12V when I plug it into your circuit.. I will let you try it and see what you may be able to do with it.
    Message Edited by lacy on 04-28-2008 05:47 PM
    Kittmaster's Component Database
    http://ni.kittmaster.com
    Have a Nice Day
    Attachments:
    Possible Constant Power Load.JPG ‏285 KB

  • What is the best way to make a clickable grid

    What would be the best way to make a clickable area that can
    differentiate between discrete parts of the area when clicked on.
    In other words, instead a having multiple buttons in a row that the
    user can click on, is there a way to have an area that has lines to
    distinguish the different areas(buttons) but that acts as though
    there were multiple consecutive buttons?
    For example, if I wanted to graphically simulate the buttons
    on a phone but without using buttons. Instead use some kind of grid
    or area that is divided into multiple sub areas that can
    distinguish the discrete positions (each button on the phone, or
    sub-area).
    Thank you,
    Salchichasa

    I liek your idea of having multiple images in a grid. I think
    that would be the best bet as you mentioned. Having one big picture
    would be hard to distinguish the sub-areas with mouse coordinates.
    I think checking the coordinates for the mouse would be very
    tedious because I would have to check for the left boundary, the
    right, top, and bottom for each sub-area!
    What do you mean by using button components and reskinning.
    Is this simply using buttons and changing the way they look? I'm
    just trying to save time and memory, because if I had a 10 by 10
    grid, thats a hundred buttons. Wouldn't that slow down the machine
    alot? And for that matter wouldn't having a grid of 10 by 10 images
    also by the same deal?
    Thanks for the input, I'm just trying to find the most
    efficient way to do it.

  • What is the best way to make a program fit different monitor resoultions?

    In our lab all our test stations have 1280x1024 resoultion monitors. In the "other lab" all the test station monitors are 1440x900 resoultion.
    Now I am tasked with making my programs run on the test stations in the other lab. I have tried setting the options "maintain proportions of windows for different monitor resoultions" and "Scale all object on front panel as the windows resizes" and of course neither one of these options really does what I would expect it to do.
    What is the best way to make programs fit different monitor resoultions?

    J-M wrote:
    I resize the Front Panel when the program start to fit the monitor resolution.  After that, I use the "SBE_Determine If Screen Resized.vi" from TomBrass (http://forums.ni.com/t5/LabVIEW/Resizing-controls-on-a-tab-control-within-a-pane/td-p/1520244 ).  This vi is very useful if you don't want to monopolize the CPU with the "Panel Resize" event.
    I don't like this function for a couple reasons.  First for the example you don't need any custom code to handle the window resizing, just use a couple splitters.  Even if you did need to handle the resize, you only resize after the mouse is up after the resize which is not how normal Windows programs work they resize as the mouse moves.  So I modified the VI to resize objects as you resize the window.  Then because doing this can generate 100 events very quickly, I use a boolean in a shift register to make sure that we only handle the resize event if there is no new resize events after 0ms.  This essentially makes a lossy queue and handles the last resize event.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Resizable_Graph.vi ‏22 KB

  • What is best way to make business cards in iwork

    what is the best way to make business cards.  is have iwork.  the business card templet doesn't seem to copy after you create the first card.  it wants each card on the temp. page to be filled in.

    You can buy a set of backup disks from Adobe for a nominal fee. You might want to give them a call and ask about it.
    Otherwise, just back it all up to an external drive.
    Bob

Maybe you are looking for

  • Web-server switch colors from blue to red

    Hi, on a linux-box is a labview-vi running and I am able to get the vi with the .snap? or the .monitor?-command over the web. But the colors of the jpg are switched from blue to red and red to blue. Any Idea? Thanks a lot! Peter Schmitt Carl-Schaefer

  • Mistake in Adobe Reader work

    hello! I use Mac book air 10.8.4. Lion OS When I open PDF file via PDF reader it closes immideately and shows next mistake. Could you please help me to solve it. Sincerely yours, Elena Process:         AdobeReader [4057] Path:            /Application

  • Setting up custom buttons

    Hi there, We're looking to use Prelude for live logging on a Ob Doc. The logger will work with two cameras logging their feeds out on location. Using the buttons like 'A' and 'B' should be helpful for distinguishing which camera the notes relate to i

  • Help with maintenance task

    Hi All, Anyone can also help with this issue? Maintenance task question Thanks

  • I have i phone 3g with 4.1 os. In that i am not able to download what app and facbook.    plz help me

    I have i phone 3g with 4.1 os. In that i am not able to download what app and facbook.    plz help me