I found the library - jFX.
I loaded the library - Private fx As JFX
It compiled
BUT crashes as soon as I hit Module calling callind JFX
Below are a starting errors
Waiting for value (100 ms)
Waiting for value (100 ms)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
If it's a nonUI app the the fx.ShowExternalDocument is unlikely to work as it requires JavaFX.
Try this:
B4X:
ShowURI("http://google.com") 'Call
Public Sub ShowURI(Address As String)
Dim Desktop As JavaObject
Desktop.InitializeStatic("java.awt.Desktop")
Desktop = Desktop.RunMethod("getDesktop",Null)
Dim URI As JavaObject
URI.InitializeNewInstance("java.net.URI",Array(Address))
Desktop.RunMethod("browse",Array(URI))
End Sub
Tested on Windows, they are standard java classes so should work on Mac.
Then I would think there is something else going wrong within your app. Are there any messages in the log? Can you post an example project where it fails?
Apparently so. Running Debug presents no errors. I don't know how to trace the errors in Runtime.
I added the code to the Sub Class_Globals and on the Sub sendclicked_click(params As Map) I added ShowURI(ndz) where ndz is the URL.
JavaObject is in my Labrary. Any other resource needed? I will keep all posted.
I'm not sure I understand what you have done, Sub Class_Globals should only contain variable definitions. It would be much easier to help if you could post some example code.
Attach is one of the Modules. When extracted it is in ODF format and all the color is overwhelming but the areas of code are highlighted in Yellow. Is there a better way to display the code?
In Debug it is using the correct link but in Release it is using the WRONG link!
If you run grok3.com use the Login Grok and PWD as 12. Select Grok, BlgID: 43 and the next screen there will be a button called Goo Docs - Click it.
A listbox will appear at the botton with the link: (which is correct)
The link is created by referencing a MySql table that has a field called Label and Link. When the record is saved the label is User Input and the Link is Pasted from google docs. A ListBox query is then run to populate the ListBox which concentrates the Label along with the Link (LabeNamel http Link). The Sub SendClicked_Click then extracts only the Link which I use the variable ndz (no particular reason). Then ShowURI(ndz) executes the Public Sub ShowURI(Address As String) as below
Public Sub ShowURI(Address As String)
Dim Desktop As JavaObject
Desktop.InitializeStatic("java.awt.Desktop")
Desktop = Desktop.RunMethod("getDesktop",Null)
Dim URI As JavaObject
URI.InitializeNewInstance("java.net.URI",Array(Address))
Desktop.RunMethod("browse",Array(URI))
End Sub
It looks to me as if the link on the page is not created properly. Although the link is displayed correctly I would guess that the href for the link points to the wrong address. It is not visible in the source code of the page.
I think I am making way too complicated. All I want to do start a new tab with the selected URL.
Something like this should work bldgp.sethtml("<a href=" & "'" & ndz & "'" & " Target = "_blank" rel="noopener noreferrer"></a>") but I can't get syntax right.