Share My Creation JavaFX application in WebPage.

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
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
    3.3 KB · Views: 327

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: :

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
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":


I followed this tutorial:



and only added that to it:



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
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
Its your choice to share or not
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…