Drawing New Components too Late?

Hello everyone,
I have a snippet of code here involving a 'please wait' sheet. Similar to a loading screen i would imagine.
if (player.getComponent() != null)
   JFileChooser fc = new JFIleChooser();
   int FCVal = fc.showSaveDialog(this);
   if (FCVal == JFileChooser.APPROVE_OPTION)
      su.showSheet();
      player.produceJPEGSnapShot();
      su.hideSheet();
}The problem lies in the su.showSheet(); Where the method draws a 'sheet' frame onto the main UI frame, as a JInternalFrame. It does do it, however it seems to 'wait' to draw it until this current thread is free. And thus not actually showing anything. I have tried wrapping a new thread around this as well, same result.
produceJPEGSnapShot() is a method that takes a good 2-3 seconds to complete.
Anyone know any other way to do this?

You'll likely need to use a background non-EDT thread to do your busy work. Something like so:
    if (player.getComponent() != null)
       JFileChooser fc = new JFileChooser();
       int FCVal = fc.showSaveDialog(this);
       if (FCVal == JFileChooser.APPROVE_OPTION)
          su.showSheet();
          // the background thread starts here
          new Thread(new Runnable()
            public void run()
              player.produceJPEGSnapShot(); // do this off of the EDT
              SwingUtilities.invokeLater(new Runnable()
                public void run()
                  su.hideSheet();  // do this on the EDT but only *after* player finishes his thing
          }).start();
    }Edited by: Encephalopathic on Jun 12, 2008 2:04 PM

Similar Messages

  • Drawing new components

    Here's a question that's plaguing me.
    What should I do if I wanted to draw a component(either applet or Swing and maybe both) differently from what it used to be?
    For example, I want my button not to be rectangular but circular(doesn't have a rectangular border of course!)
    Do I override some method? Which is it?

    here's a good example: http://java.sun.com/products/jfc/tsc/articles/swing2d/index.html

  • I got busy over the new year and forgot to purchase Applecare for my iPhone.  30 days past purchase date is too late - right?

    I got busy over the new year and forgot to purchase Applecare for my iPhone.  30 days past purchase date is too late - right?

    Thanks Peter.  I thought about that and had discounted the idea but since I am only 30 minutes away from my A store, I think I'll give it a try. I can be charming specially when I wear clean jeans and a nice top. :-) 
    Jerry H

  • Every time I connect my new iPad2 too my Sony laptop a pop up comes out saying " the iPad cannot be used because it requires iTunes version 10.5 or later. Can someone please help me!.

    Every time I connect my new iPad2 too my Sony laptop a pop up comes out saying " the iPad cannot be used because it requires iTunes version 10.5 or later. Can someone please help me!.

    Download and install the latest iTunes. Once you  satisfy that requirement the warning will go away.

  • I set up my ipad as a new ipad rather than syncing it to my iphone.  Can I still do this or is it too late??

    I set up my ipad a s new ipad rather than syncing with my iphone.  Can I still do this now that it has been set up or is it too late?

    Depends on what you want to sync.
    Contacts and calendars - yes with icloud.
    photos yes with computer and future pictures with icloud.
    Apps - does not make since, since apps are different for ipad and iphone.

  • HT2417 my iphone 4s voice messages repeatedly disappear and reappear at random. When they do reappear, I cannot listen to them. Sometimes, they eventually come through but usually too late to respond

    I have an iphone 4s with Sprint. Ever since I switched from my iphone 3G with ATT, I have had incredible frustration with the voicemail system. Periodically, my voicemails on the new phone disappear; all messages old and new. This occurs out of the blue. Similarly they at times reappear, but the new messages have no content and all show up as 0.00minutes. Randomly, some messages retrieve their content and I can listen to them, often too late to respond to the caller. This is very annoying and almost questions why the voicemail exists at all. I have taken the phone to Sprint multiple times and performed countless resets with no recourse, hence they suggested contacting Apple. Has anyone else experienced this or know of a viable solution? iOS is up to date, phone only used in USA
    Thanks

    I have an iphone 4s with Sprint. Ever since I switched from my iphone 3G with ATT, I have had incredible frustration with the voicemail system. Periodically, my voicemails on the new phone disappear; all messages old and new. This occurs out of the blue. Similarly they at times reappear, but the new messages have no content and all show up as 0.00minutes. Randomly, some messages retrieve their content and I can listen to them, often too late to respond to the caller. This is very annoying and almost questions why the voicemail exists at all. I have taken the phone to Sprint multiple times and performed countless resets with no recourse, hence they suggested contacting Apple. Has anyone else experienced this or know of a viable solution? iOS is up to date, phone only used in USA
    Thanks

  • How do I properly setup pin and gate swap groups on new components​?

    Hi,
    I've looked for some documentation explaining exactly how the pin and gate swap functionality works but I have not been successful.
    I am trying to get pin and gate swapping working correctly on some digital logic components that I have created (side question - why no modern 74 series logic components like LVC?) as well as RPACKS and some connectors.
    Is it a requirement to create a multi-section symbol to enable gate swapping?  I can't seem to get it to work unless the symbol has multiple sections.  It doesn't work by default for the RPACKs included in Multisim.  If it's possible to do gate swapping by putting the pins of each gate in their own gate swap group I would really like to understand what I'm doing wrong.
    In the Component Properties 'Footprint' tab you can define the 'Pin swap group' and 'Gate swap group' settings.  I have not seen any documentation explaining this and frankly, I'm quite confused by it when using existing 74 series parts as examples.  The single section symbols don't have any pin swap or gate swap groups defined and the multisection symbols have only one gate swap group and then put all inputs in one pin swap group and all outputs in another pin swap group.
    I would really appreciate it if someone could point me to documentation that explains how to do this.  The help files are quite poor in my opinion - they seem to only be able to point out the obvious.  The 'Getting Started,' 'Fundamentals,' etc. type guides don't mention this stuff at all.  The 'User Guide/Manual' (both of which appear to be outdated?) do not explain this and frankly don't have very much information about pin and gate swapping at all.
    I'm hoping I'm just missing something obvious.
    On a related note - I'm having some trouble working with some of these multisection components.  When I want to change the footprint or update the component after making a change to the component in the database I can't seem to find a quick way to do this.  It seems that I always have to go through a drawn out process of 'Replacing' each individual symbol section.  Is there a faster way to do this?
    Thanks,
    Kleven

    Hi Pat,
    I'm working with some SAMTEC connectors.  I don't expect you guys to have these built by default in the library - they are somewhat custom.  But just so you can consider it, we are using the TFM and T2M family of connectors and I'm adding them as additional footprints for the standard dual row headers.  I'm having some trouble with the footprint for the TFM screw-down option since it is a very odd footprint, but I'm going to start a seperate thread discussion for that since I really just need to understand how to manipulate Ultiboard to get the desired result and it's really a different discussion.
    As for RPACKs, I'm a little confused about how Multisim currently supports these. The Value tab in the properties dialog only lets you set the resistance.  Why isn't this more like the resistor value tab?  Since the Value tab is modified like a virtual component it's disappointing that it doesn't offer more capability like the other virtual passives.  In my limited experience I've seen the isolated-4 resistor pack used the most, but like I said, that is limited experience.  It would be nice if some surface mount footprints were added to the master database for RPACKs in the future.  4x0402, 4x0603, and 4x0805, concave and convex, seem like pretty common footprints as best I can tell.
    Virtual components work great in a purely physical design because you can easily change the footprint in the 'Value' property tab.  With the provided RPACKs and LEDs you can't do that, so I had to create new components in the User/Corporate database.  Of course, the LED can't be copied so I had to create it from scratch.  But the RPACK could be copied even though it had a modified Value tab, implying it is a virtual component, if I understand correctly.  Maybe these distinctions and limitations are well defined but I found it somewhat confusing that there were several common parts I had to either copy and modify or build from scratch.
    Since I created those parts, we updated to the PowerPro version and though I'm not certain, I think I can change the footprint in the spreadsheet view.  But in the standard version, I didn't see a way to change the footprint without replacing the component.
    Also, it seems like changing the footprint does not behave quite like I would expect.  If I have a database part which has multiple footprints mapped already, I would expect to be able to choose between those footprints already supported by the database part when I try to change the footprint using the Properties->Value tab or the spreadsheet view.  If I need to change to a footprint that currently is not associated with the component in the database, I would expect to have to edit the database part, add the footprint, map the pins, re-save the component, then update the component in the schematic.
    Is my thought process making too many assumptions here?  I understand that I am one person creating one design in one specific way.  So I'm sure I'm missing some usage cases or intended uses of the tool, especially since I haven't taken any training for this software and have tried to teach myself how to use it over the last 9 months.  And I have noticed that even for virtual resistors and capacitors, the footprint selection dialog is the same - a selection from the database and setting up a new pin mapping.
    As for 74 series parts, seeing the LVC family would be very nice.  This is 3.3V-2.5V and seems like the next logical step for lower voltage support.  It would also be nice to see some surface mount footprints with the 74 series parts.  This isn't a big deal though - it didn't take me long to create the parts I needed by copying and editing from the Master database.  And since I'm not using the simulation models, that made it even easier.  Since I haven't looked into the models at all, I don't know if that would have taken longer to convert to the LVC family.
    I've probably rambled enough for now.
    Thanks!
    Kleven

  • HT1212 okay so i entered the wrong passcode cause i forgot it for a while . i just remembered my passcode but now it is too late and it wont connect to itunes an the message on my ipod saying disabled will not go away . ):

    so i forgot my ipods password an its disabled and now i remember my password an its too late and wont connect to itunes . any suggestions on what i can do ?

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • I am trying to watch Prof. Susskind's video lectures from Stanford univ.U-tube lec work fine.With itunes video and audio have synch problem.Is there a way to fix this or the people who uploaded messed up and it is too late?

    I am trying to watch Prof. Susskind's lectures from Stanford Univ. U-tube lectures work fine.With I-tunes, there is a synchronization problem between audio and video. Is there a way to fix this or the people who uploaded messed up and it is too late?

    I had thought this situation was solved but it just got worse. In addition to being without service for several days I am now being charged  a cancellation fee for a broadband service that BT disconnected in error. BT Vision was also terminated by BT but the set up charges are still in place. Does anyone know who the relevant Ombudsman is? I called BT from America on Friday - for an hour - while someone called Aruj sorted out why there is an order 'in progress' that I didn't initiate; why I have fees relating to a problem created by BT and why there are references to a house move that didn't take place and a BT Vision service I no longer have but didn't cancel myself. He assured me it would be rectified and my bill would be reduced by 139 pounds and we would get confirmation of this later that day. I asked him what chance there was that this would not actually happen - he said no chance at all; my new bill would be 23.50.
    There was no text message. An online chat person today told me there had been a fee reduction request which had been declined and there was nothing else he could help me with as he dealt only with broadband. But he would get BT Vision to email me. They always seem so helpful.............
    I'm sure I'm listed somewhere as 'a problem', there's no other explanation for why I get the runaround

  • Too late to re-activate adobe ...so it closed

    Hello
    Have I done a catastrophic mistake by being too late to re-activate my Adobe creative suite?
    I have had computer problems. When I in the end bought a new computer and tried to install Adobe, the re-activation time had run out.
    I did have a possibility to re-activate it off course, but didnt do it immidiately, since I was about to re-install everything in the new computer, and then problems arouse that delayed everything ...and then suddenly it was to late.
    I will contact support by phone tomorrow. But if someone can ease my pain, by hinting that it is possible to re-activate it, I will get some sleep tonight...
    cheers/Johan

    Phillip,
    I AM a wino! I mean hey, look at that glass. It was NOT a Riedel Sommelier Burg glass. Only a true wino would use such a glass. Seems that my review of that restaurant was very critical of their stemware. Food good, wine list well-suited for the menu at a fair "resort price," but the stemware needed a real upgrade. I write that a lot though.
    Personally, I would like to see the max. installs increased, as there are many good reasons for people needing to do more than the 5-10 (?) allowed. Not that long ago, a PS user was complaining in the forum, that he could not uninstall his copy of PS every night, when he left the office, so that the cleaning crew could not use it. He wanted unlimited installs. That was a really odd idea, but then I do not know his cleaning crew... Now, Activation does not rub me the wrong way, like it does many. Maybe it is because that I have never had an issue with it. Had I, my opinion might be different.
    Adobe, however, knows what they are doing. They write the software, and make the rules. I just buy their software to make my living, and play by their rules. I know that that statement does not belie my "Libertarian" nature, but then I've been a loyal buyer/user for over two decades.
    Hunt

  • Too late to buy warranty?

    Just bought a Dell Studio MT Desktop Q8200 November 30 (3 days ago). I did not buy an  extended warranty at the time. I wasn't aware of the arrangement Dell had w/Best Buy about warranties until today and I would like to buy a extended warranty now. Is it too late to do this?

    Hey Kbp13 -
    Congratulations on your new Dell desktop.  I purchased one a few months ago in our stores and thus far I have been quite pleased.
    The good news is that you do have 14 days from date of purchase to buy the Performance Service Plan.  Keep in mind, the store may ask you to bring the tower in to have it inspected to ensure that it is in like new condition.  Your best option is to contact the store prior to driving there and receive clarity from them. 
    I hope this helps!
    Dorothy
    Community Connector
    Best Buy® Corporate
    Dorothy|Social Media Supervisor | Best Buy® Corporate
     Private Message

  • Too late to add user account?

    I have been working in my administrator account since buying my iMac G5 in December. I understand the wisdom of using a user account instead. I am wondering if it is too late to add a user account. If I do that, can I import the folders and files from my administrator account to the user account?
    iMac G5 2.1 GHz with iSight   Mac OS X (10.4.7)  

    The easy way is to create a new administrator account, them demote your old account to non-administrator.

  • Too late to switch?

    I want to change over to the unlimited data plan. Right now I have a feature phone with the $10/25MB month plan. Is it too late to change if I'm going to switch online? I wanted to get a pre-owned iphone but I didn't know if I ordered one today or tommorrow and changed the plan(which you have to do anyway) would I be grandfathered into the unlimited plan or does it take effect when you physically activate the phone. If that's the case I guess I'll have to go to the verizon store tommorrow and get a brand new iphone.(the phone online wouldn't get here until Thursday or Friday) Does anyone know? Thanks for any info.

    Sorry for the late response. I hope you were able to find an answer for this issue. If you upgraded to a smartphone before 7/7, you will be able to keep the unlimited data plan. If you haven't upgraded yet, you will be able to choose from our new data pricing. 

  • Is It Too Late to Create a Version Set?

    I have several photos that I edited and saved, but I did not save them as version sets.  Now I would like to convert each of them to a version set -- the edited photo on top of the original photo.  Is it too late to do that?
    Thanks for any suggestions.

    Sorry, I forgot to mention the details -- I'm using PSE8 on a laptop with Win7 (64bit).
    Yes, my terminology is confusing because I'm fairly new to this and not exactly sure what I'm doing.  I am following the example of an Adobe technician who led me through a process whereby I could move photos from one catalog to another.  I have 5 catalogs, two of which contain many thousands of photos each.  The other 3 catalogs are more specialized and thus smaller.  My Flower Catalog, for instance, contains a couple thousand pictures.
    This is my routine:  I download my photos into one of the larger catalogs (File>Get Photos from Card Reader).  If I have a photo of a flower in the group, I edit it and save it in a version set or stack.  Then, in order to "move" it to the Flower Catalog, I select and copy it (Ctrl+C).  Then, in Explorer, I open the Flower Catalog and paste it. Then, when I return to PSE8 and open the Flower Catalog (a watched folder), I get the message that a new photo has been found and do I want to add it to the browser. (This photo, unfortunately for me, is not the version set or stack but only the top, edited, photo.)  I add it to the browser.  The properties show that its location is now in the Flower Catalog.  Then I go back to the larger catalog and delete the flower photo from that catalog (not the hard disk).
    A convoluted system, but it works except for keeping the version set or stack intact.
    Does anyone have a better, foolproof way of moving a file from one catalog to another?  Especially a way that will keep the version set or stack together?

  • I never heard about the Macbook recall for cracked casing along the bottom of the keyboard. Is it too late to get it fixed?

    I never heard about the Macbook recall for cracked casing along the bottom of the keyboard. Is it too late to get it fixed?

    I realise maybe your personal issue was sorted, but it may help others:
    I took my wife's 3-year old Macbook into the genius bar yesterday expecting to pay for a new casing, but was told there was still an extended warranty for Macbook plastic case (provided up to 5 years old and no signs of abuse)
    They will replace the top case and screen bezel at no cost, which I think is excellent service.

Maybe you are looking for