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: Calling NSApplication -hideOtherApplications from Java JNI not working.




On Sep 13, 2006, at 1:41 AM, Rob Ross wrote:

I am trying to get a simple native Cocoa API method to work via JNI. I want to try to hide all other applications.

I seem to have two choices, by calling -hideOtherApplications on either NSApplication or NSWorkspace. But neither seems to be working for me.

I coded it like this...

import macnative.jnidirect.cocoa.application.NSApplication;

public class AppTesting {

	public static void main(String[] args) {
		NSApplication app = NSApplication.sharedApplication();
		app.hideOtherApplications(0);
	}
}

When run from Terminal it did nothing. When run from my application it appeared to work. I had to quit the application to get the other applications to show back up.
I've seen this before and think it may be because the application provides a full-blown AppKit derived Swing/AWT/GUI'd application that terminal does not provide.


<shame-less plug>
Use my java command line application to test your Cocoa JNI using quick and dirty command line tests
It is actually a full-blown AppKit derived SwingAWT/GUI'd application that looks and works something like Terminal.
</shame-less plug>


Or anyhow test somehow from your own full-application and don't expect everything to work right from simple CLI based tools.


Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Calling NSApplication -hideOtherApplications from Java JNI not working. (From: Rob Ross <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.