Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  is it possible to launch default web browser from java program?  (Read 1067 times)
0 Members and 1 Guest are viewing this topic.
Offline kylix999

Junior Duke





« Posted 2006-02-07 14:32:34 »

i would like to make  my program  able to launch a web browser for example mozilla with some address url.
 it can be made using Proccess.exec, but i was thinking is it possible to do it in another way to launch DEFAULT user browser and also it should work on all platforms, of course i am talking about java programs not applets
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #1 - Posted 2006-02-07 14:51:18 »

If you were using an Applet, it would be easy. (Check the Applet methods for more info.) Otherwise your best option is JDIC. Webstart also provide the "showDocument()" method in javax.jnlp.BasicService.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline kylix999

Junior Duke





« Reply #2 - Posted 2006-02-07 15:17:09 »

jdic is very intresting, i also found intresting article about it here:
http://www-128.ibm.com/developerworks/java/library/j-jdic/
but i was thinking is it poosible to make it withut native libs, but this is also good, thanx jbanes

and there is also jrex :  http://jrex.mozdev.org/docs.html
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #3 - Posted 2006-02-07 15:27:21 »

Glad to be of service. Just so you know, there's also the Browser Launcher library that's (supposedly) 100% Java. JDIC, OTOH, is slowly moving into the Java core, starting with release 1.6. So it's something of a toss-up as to which option is "better". Good luck!

Java Game Console Project
Last Journal Entry: 12/17/04
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #4 - Posted 2006-02-07 15:30:38 »

it is easy to do without native libs.

Check the platform and run the command line that makes sense for the OS you are on.

Mac OS you can use "open  <url>"
Windows has a couple options, "cmd /C start /B <url>" works,and a more direct way, (I think this works) is "rundll32 SHELL32.DLL,ShellExec_RunDLL <url>"
Linux... is more troublesome Smiley

Offline kylix999

Junior Duke





« Reply #5 - Posted 2006-02-07 15:46:22 »

you are the best guys, browser launcher is that what i was looking for, but it is quite old and some functions especially for macintosh are not working , but there is a new implementation of launchbrowser here which is the best and free: http://browserlaunch2.sourceforge.net
and supports probably all systems:

Linux (2.4.x or higher)     FireFox, Mozilla, Netscape, Konqueror, Opera     Supported     Supported     
Mac OS X (10.2 or higher)       Supported    
SunOS    Mozilla, Firefox, Netscape    Supported    Supported    The default browser is invoked using the sdtwebclient command.
Windows 2000    Mozilla, Firefox, IE    Supported    Supported.    
Windows 2003    Mozilla, Firefox, IE    Supported    Supported.    
Windows 98    Mozilla, Firefox, IE    Supported    Supported.    
Windows NT    Mozilla, Firefox, IE    Supported    Supported.    
Windows XP    Mozilla, Firefox, IE    Supported    Supported.

and some intresting discussion can be found here: http://www.codecomments.com/archive245-2005-12-724947.html

also you may be intrested in this project :   http://multivalent.sourceforge.net/

again thanx guys
Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #6 - Posted 2006-02-07 17:42:17 »

Mustang provides an API to launch the default browser and other tools such as email client. Check on javasoft.com for the article on the API. Of course you have to stick to Java 6, which may have a major impact on the deployment of your app.

Offline kylix999

Junior Duke





« Reply #7 - Posted 2006-02-12 13:51:03 »

browser email client in mustang cool, more can be found here:
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/desktop_api/


thanx TheAnalogKid
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!