Share My Creation JavaFX application in WebPage.

After building a complex access-control, security Application in B4J and running like a charm for 3 years, I get the question to turn this in a Web-application.
This Application is that complex, that it is not possible to turn this, a easy way, in a Web-Application.
This means rewrite the hole application again for web.
I have found a way to let the application run in a Web Browser.

More info and Images follow
 

rboeck

Well-Known Member
Licensed User
Longtime User
Hi,
yesterday i could successfully use my b4j app on an ios machine, ipad, android mobile. I see some small sizing problems, where the orginal size is not exactly the same as in webswing. I had small problems, my app did not close properly and so the webswing batch file was not stable.
I want to try to transfer webview on my qnap nas and try to use it together with the included webserver.
What i am looking for is what happens, when my webswing.bat file does not repond or stops working.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi,
yesterday i could successfully use my b4j app on an ios machine, ipad, android mobile. I see some small sizing problems, where the orginal size is not exactly the same as in webswing. I had small problems, my app did not close properly and so the webswing batch file was not stable.
I want to try to transfer webview on my qnap nas and try to use it together with the included webserver.
What i am looking for is what happens, when my webswing.bat file does not repond or stops working.
I have seen that on Linux the fonts are not the same as in Windows. This is not the problem of Webswing but Linux has not the same Fonts then windows.
About the size can you share some screenshots?
I also had to make some small adjustments for the Forms but solve this with a parameter for Desktop and Web. Like

Using Args for webswing:
 If Args(0).ToLowerCase = "webswing" Or Args(0).Contains("web") = True Then
   WebSwing = True
End If
You can use that like the image say.
 

Attachments

  • 2020-04-23_9-14-03.png
    2020-04-23_9-14-03.png
    3.3 KB · Views: 389

Swissmade

Well-Known Member
Licensed User
Longtime User
I see some small sizing problems, where the orginal size is not exactly the same as in webswing. I had small problems, my app did not close properly and so the webswing batch file was not stable.
The Size of forms is in the webpage 25px smaller then in WIndows Desktop.
Using many Forms can be a problem Titlebar is flickering.
There is a nice solution for that.
If you are using -1, -1 for height and width make height fixed.
 

rboeck

Well-Known Member
Licensed User
Longtime User
Here are two screenshots:
Pic1.png
pic2.png
:

The left one is show with webswing, you are right, this can be 25px.
I had the sizing problem with ios and tried to solve it to use the same css file. Your idea with commands is currently needed to solve them.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi all
I hope you can use WebSwing.
Now I have a question.
Because WebSwing is using the server Side, we can not reach the Local Client PC like folders and printers.
Have anybody solved this with JavaScript or something else ??
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Here are two screenshots: View attachment 92432View attachment 92433:

The left one is show with webswing, you are right, this can be 25px.
I had the sizing problem with ios and tried to solve it to use the same css file. Your idea with commands is currently needed to solve them.
What you can do here is also a option.
Take your Form layout and add there your own TitleBar.
Change your MainForm.SetFormStyle("UNDECORATED")
Then you have solved your problem.
 

jmon

Well-Known Member
Licensed User
Longtime User
Thanks a lot for sharing this! I managed to run my Java 11.0.1 app in the browser in 5 minutes:

This one

in full screen with form decorations set to "UNDECORATED":
Capture2.PNG


I followed this tutorial:



and only added that to it:

Capture3.PNG


This is great, that's opening so many doors, it's incredible. Thanks a lot!
 
Last edited:

Swissmade

Well-Known Member
Licensed User
Longtime User
Thanks a lot for sharing this! I managed to run my Java 11.0.1 app in the browser in 5 minutes:

This one

in full screen with form decorations set to "UNDECORATED":
View attachment 92746

I followed this tutorial: and only added that to it:

View attachment 92747

This is great, that's opening so many doors, it's incredible. Thanks a lot!
Create a nice Titlebar if needed and some functions what I can post here to move the form.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Move the Form with your own Titlebar and Form Undecorated:
Sub imgTitleBar_MouseClicked (EventData As MouseEvent)
    UserForm_CloseRequest(EventData)
End Sub

Private Sub lblTitleBar_MousePressed (EventData As MouseEvent)
    xMouse = EventData.X + lblTitleBar.Left
    yMouse = EventData.Y + lblTitleBar.Top
End Sub

Private Sub lblTitleBar_MouseDragged (EventData As MouseEvent)
    If isMaximized Then Return
    Dim jo As JavaObject = EventData
    Dim l As Double =  jo.RunMethod("getScreenX", Null) - xMouse - Main.MainForm.WindowLeft
    Dim t As Double =  jo.RunMethod("getScreenY", Null) - yMouse - Main.MainForm.WindowTop
    If l < 9 Then
        l = 9
    End If
    If l + ParentForm.Width > Main.MainForm.WindowWidth - 9 Then
        l = (Main.MainForm.WindowWidth - ParentForm.Width) - 9
    End If
    If t < 59 Then
        t = 59
    End If
    If t + ParentForm.Height > Main.MainForm.WindowHeight - 23 Then
        t = (Main.MainForm.WindowHeight - 23 - ParentForm.Height)
    End If
    ParentForm.Left = l
    ParentForm.Top = t -15

End Sub
You need to change the label and the image to your own names.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Using Webroot is also interesting.
Place there your own index.html and you will get this as background.
 

Xandoca

Active Member
Licensed User
Longtime User
Hi, it seems that is not free if you don't share the code.

For OEMs, ISVs, VARs and Other Distributors of Commercial Applications:

OEMs (Original Equipment Manufacturers), ISVs (Independent Software Vendors), VARs (Value Added Resellers) and other distributors that combine and distribute commercially licensed software with Webswing and do not wish to distribute the source code for the commercially licensed software under version 3 of the GNU Affero General Public License (AGPLv3) must enter into a commercial license agreement with Webswing Ltd.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi, it seems that is not free if you don't share the code.

For OEMs, ISVs, VARs and Other Distributors of Commercial Applications:

OEMs (Original Equipment Manufacturers), ISVs (Independent Software Vendors), VARs (Value Added Resellers) and other distributors that combine and distribute commercially licensed software with Webswing and do not wish to distribute the source code for the commercially licensed software under version 3 of the GNU Affero General Public License (AGPLv3) must enter into a commercial license agreement with Webswing Ltd.
Hi
Its your choice to share or not
 
Top