Ha! I spent yesterday struggling with bringing my application to the
foreground, and joined this list yesterday evening; it's a wonderful
coincidence to find that topic being discussed!
I had come up with Mary's solution, but I was using the following
applescript
"tell application \"MyApp\" to activate"
which works as long as you've built your code into a full application
bundle.
My app does bits of AppleScript quite regularly and it isn't always
very snappy to have to fire up a new osascript process every time. But
the NSAppleScript classes do seem to be broken unless you're running in
a full Cocoa-Java app, so osascript appears to be the only way.
However, for this particular problem, Bill's earlier post led me to:
I could make the suggested solution work by executing the script
"tell application \"Finder\" to set frontmost of application
process \"JavaApplicationStub\" to true"
but not using my application name.
_______________________________________________
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