B4J Question More "Geometry" Problems (No2) - B4J 6.8 with OpenJDK 11

Discussion in 'B4J Questions' started by GuyBooth, Dec 6, 2018 at 11:22 PM.

  1. GuyBooth

    GuyBooth Active Member Licensed User

    I recently ran into problems with the progress bar, being fooled into thinking it wasn't working. I reported it on this thread https://www.b4x.com/android/forum/threads/b4j-6-8-with-openjdk-11-progress-bar-not-working.99878
    Now I have encountered two more problems - theseecond I describe here:

    I load a form using this code:
    Code:
    frmCDAddition.Initialize("frmCDAddition",MB_Add.frmMBAddition.Width-25, MB_Add.frmMBAddition.Height-32)
        
    'Load the main layout file
        frmCDAddition.RootPane.LoadLayout("dtmm_mbaddcd")
        frmCDAddition.SetOwner(MB_Add.frmMBAddition)
        frmCDAddition.AlwaysOnTop = 
    True
        frmCDAddition.Title = 
    "MusicBase CD Addition"
        frmCDAddition.Resizable = 
    False
        frmCDAddition.SetWindowSizeLimits(
    575568575568)
        frmCDAddition.Show
    Once the form has been resized (jdk 11 problem, see https://www.b4x.com/android/forum/threads/more-geometry-problems-b4j-6-8-with-openjdk-11.100157 ) the results are different. The size of the form with jdk11 is smaller than with jdk1.8 - look especially at the right hand side.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    As with the other issue you reported, you should upload a small project that reproduces it. Note that it is possible that things will not look identical. Many things have changed between Java 8 and Java 11. The visual side is mostly implemented in JavaFX not in B4J.
     
  3. GuyBooth

    GuyBooth Active Member Licensed User

    The attached project demonstrates all three issues.
     

    Attached Files:

  4. MarkusR

    MarkusR Well-Known Member Licensed User

    the problem where the form is bigger than u want i fixed with two lines WindowWidth & WindowHeight. (me used java 9)
    i guess the limit only appear if the user resize the window.

    other difference i saw u use AutoScaleAll in main form and not in the other.

    Code:
    Sub Form2

        frmCDAddition.Initialize(
    "frmCDAddition",MainForm.Width-25, MainForm.Height-32)
        
    'Load the main layout file
        frmCDAddition.RootPane.LoadLayout("dtmm_mbaddcd")
        frmCDAddition.AlwaysOnTop = 
    True
        frmCDAddition.Title = 
    "MusicBase CD Addition"
        frmCDAddition.SetWindowSizeLimits(
    575568575568)
        frmCDAddition.WindowWidth = 
    575
        frmCDAddition.WindowHeight = 
    568
        frmCDAddition.SetOwner(MainForm)
        frmCDAddition.Resizable = 
    False
       
    End Sub
     
    GuyBooth likes this.
  5. GuyBooth

    GuyBooth Active Member Licensed User

    And I thought I had tried every setting available …. with WindowWidth and WindowHeight working I can also remove the WindowSizeLimits.

    That still leaves a problem with the object size on screen being "sdk dependant", and having found two anomalies already I am concerned there may be many more ...
    Is there an "#if java11", "# if java 1.8" type of statement that would allow for two different sets of layouts?
     
  6. GuyBooth

    GuyBooth Active Member Licensed User

    I have added this code:
    Code:
    If JavaLaterThan11_Check Then
    ' jdk11
        frmCDAddition.WindowWidth = 575
        frmCDAddition.Windowheight = 
    568
    Else
    ' jdk1.8
        frmCDAddition.WindowWidth = 567
        frmCDAddition.Windowheight = 
    565
    End If
    With this sub:
    Code:
    ' Check Java Version
    Sub JavaLaterThan11_Check As Boolean
        
    Dim sJavaVersion As String = GetSystemProperty("java.version","0.0.0_00")
        
    Return sJavaVersion.SubString2(0, sJavaVersion.IndexOf(".")) >= 11
    End Sub
    Which will work for the screen sizes.
     
  7. MarkusR

    MarkusR Well-Known Member Licensed User

    in the dtmm_mbaddcd designer the anchor properties looks wrong, maybe it well help you too.
     
  8. GuyBooth

    GuyBooth Active Member Licensed User

    Appreciate your comment, but I wasn't paying much attention to them, they will be set up properly in the actual application.
     
    MarkusR likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice