Tuesday, May 22nd 2012, 1:32am UTC+2

You are not logged in.

  • Login
  • Register

Dani

Trainee

Posts: 68

Location: GERMANY

1

Friday, November 4th 2011, 4:23pm

open a link with default browser

Hey everybody,
in order to open a link to a web page from within my Jabaco progs with the default browser I am using the 'Bare Bones Browser Launch solution'

Quoted

The Bare Bones Browser Launch solution is appropriate when a compact lightweight method to open a web page is needed. Bare Bones is free and works on Mac OS X, GNU/Linux, Unix (Solaris), and Windows XP/Vista/7. ...
It will attempt to use the Desktop library from Java 6 but fall back to system calls if the library is unavailable.


It is quite reliable and very easy to use:

Jabaco Source

1
BareBonesBrowserLaunch.openURL("http://www.jabaco.org")


Press F1 in your Jabaco window and add the bare-bones-browser-launch-3.1.jar to your project.


Dani

JasonS

Beginner

Posts: 40

Location: Pittsburgh, PA, USA

Occupation: IT

2

Saturday, November 5th 2011, 9:46pm

This works well via Jabaco runtime, however, applet at run time via web browser returns an error and does not execute.

Message
Error attempting to launch web browser
java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)


I have the below the code to work the exact opposite, to -work- via browser, but -not- jabaco runtime. Go figure, lol.

Also don't forget to add java#net in resources for it to work.

Jabaco Source

1
2
3
4
5
6
Dim url As java#net#URL
Dim s As String

s = "http://www.google.com/"
url = New java#net#URL(s)
Me.Parent.getAppletContext.showDocument(url,"_newtab")


Greetings,
Jason

This post has been edited 5 times, last edit by "JasonS" (Nov 5th 2011, 10:05pm)


Dani

Trainee

Posts: 68

Location: GERMANY

3

Monday, November 7th 2011, 8:57am

Very nice JasonS!
Now we have solutions for most cases...

Rate this thread
WoltLab Burning Board