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: How to goto URL from app?



On Tuesday, July 8, 2003, at 1:00 AM, email@hidden wrote:

I have a Cocoa/Java app and I'm trying to open a particular web site
when a user hits a button. I'd like it to launch whatever the default
web browser is and go to the site. I know that applets can invoke
AppletContext.showDocument to do this. Is there a way to do this from
an app?
My app descends from NSApplication, so I don't think I can assume it's
an applet and use showDocument. Any tips?
Thanks,
Jason Rusoff

Since you have a Cocoa Java app, take a look at NSWorkspace.openURL(URL theURL) -- that should do the job.

Scott

------------------
Scott Kovatch
Apple Computer
Java Runtime Classes
Cleveland Hts, OH
email@hidden

"I don't mind change -- I just don't like being there when it happens." -- Monk
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.


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.