To find the error, you should add extra debugging statements.
It is not fully clear to me what you intend to achieve with your Java code. Is that a working original sample you intend to port to Jabaco?
A null pointer exception usually happens if either a variable is not properly initialized or an object creation failed for some reason.
To pin-down what has happened, you should trace the code execution and narrow down the area of failure.
Add code to your catch() part to actually get more information.
You are attempting four or more nested operations in a single line of code.
To isolate the error, you could spread this out to several lines and check for success at every step.
Applets on their own are difficult to trace.
It might be a good idea to try parts of your code in a stand-alone Jabaco module.
This test code should give some valuable hints:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
Option Explicit
Public Sub Command1_Click()
Dim s As String
Dim msg As String = "Hello!"
Dim url As java#net#URL
' Chr(34) is a trick to state quote characters in strings
s = "javascript:DOalert(" & Chr(34) + msg + Chr(34) & ")"
Debug.Print s
url = New java#net#URL(s)
Debug.Print url.toString
End Sub
|
Look
here for additional help.
Please post your findings
Greetings
A1880