Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why isnt my wait() and waitFor() working? please help



Shou ryuujo wrote:

>o man... didnt know it would be that complicated... so to find out if the
>application closes i have to use osascript?

Not necessarily.  That's just one way, off the top of my head.

If all you want to know is "Did the app exit?", then another way is to
launch QT Player yourself, exec()'ing it directly, so the Java Process
really does represent the app.  (You actually have to exec() the executable
file inside the .app bundle, at Contents/Resources/MacOS/Quicktime Player.
Refer to Apple's docs on bundle internal anatomy for details.)  Then you
can 'open' files for it, which 'open' will happily pass to QT Player for
playblack, but your Java app can still tell when QT Player exits.

You could also write native code that waited for an arbitrary process to
terminate.  You'd then figure out QT Player's process ID, pass that to the
native code, and voila.

You should also recognize that closing the last window in QT Player will
NOT cause it to exit.  That's a Windows-ism, not a Mac-ism.


>Another question is is there a way that i can put the quicktime application
>inside a Jpanel? i mean if i did that then i can put a button in and close
>the application that way right? thanks

I know of no way to do that on Mac OS X.  Embedding applications in one
another's windows is another Windows-ism.  It'd be simpler to use QuickTime
for Java and create a playback component.  Then you don't have to exec()
anything.  As I recall, QTJ is also available on Windows.

It might help if you told us what you're trying to accomplish by waiting
for QT Player to exit.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.