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

GuyBooth

Active Member
Licensed User
Longtime 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:
B4X:
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(575, 568, 575, 568)
    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.
 

Attachments

  • Capture3 jdk 11.PNG
    Capture3 jdk 11.PNG
    38.1 KB · Views: 248
  • Capture4 - jdk 1.8.PNG
    Capture4 - jdk 1.8.PNG
    27.7 KB · Views: 276

GuyBooth

Active Member
Licensed User
Longtime User
As with the other issue you reported, you should upload a small project that reproduces it.
The attached project demonstrates all three issues.
 

Attachments

  • Demo Project sdk1.8 v sdk11.zip
    4.4 KB · Views: 251
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime 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.

B4X:
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(575, 568, 575, 568)
    frmCDAddition.WindowWidth = 575
    frmCDAddition.WindowHeight = 568
    frmCDAddition.SetOwner(MainForm)
    frmCDAddition.Resizable = False
   
End Sub
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
the problem where the form is bigger than u want i fixed with two lines WindowWidth & WindowHeight. (me used java 9)
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?
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
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 ...

I have added this code:
B4X:
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:
B4X:
' 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.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
in the dtmm_mbaddcd designer the anchor properties looks wrong, maybe it well help you too.
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
in the dtmm_mbaddcd designer the anchor properties looks wrong, maybe it well help you too.
Appreciate your comment, but I wasn't paying much attention to them, they will be set up properly in the actual application.
 
Upvote 0
Top