B4J Question Java jdk-11.0.3 display problems

Robert Valentino

Well-Known Member
Licensed User
Longtime User
When I compile with Java \jdk-11.0.3 my TreeTableView Display looks like this (Notice the Arrows are overlaying the text item)

1603812967886.png


But when I use jdk1.8.0_201 the display is fine.

1603812990616.png


Is there a reason that the jdk-11.0.3 version is causing this?

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Your right, my bad. I am using 8.5 and that is 6.8 sorry was thinking the next version would be 8.6 the old age and dyslexia set in. Sorry
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Same problem with OpenJDK 14

Is this because I am using a Label for my column display?
Is there anyway to offset the Label when it displays in the column?
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
As a temporary fix I am putting a TAB before the text when I create my label, which make everything look right

Not exactly the same as with java 8 (tab indents a little more), but something I can live with until there is a fix.

B4X:
Private Sub CreateTextLabel(TextToShow As String, SetColor As Boolean) As Label
            Dim MakeLabel As Label
    
            MakeLabel.Initialize("")
            MakeLabel.Font    = fx.DefaultFont(18)
            
#if _Fixed_            
            MakeLabel.Text    = TextToShow
#else
            MakeLabel.Text    = TAB &TextToShow
#end if            
            
            If  SetColor Then
                MakeLabel.TextColor = fx.Colors.Blue
            End If
    
            Return MakeLabel
End Sub

1603831480214.png
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Looks like you need to set the padding yourself with Java 11+. This is simple:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
    For i = 1 To 10
        Dim t As TreeTableItem
        Dim lbl As Label
        lbl.Initialize("")
        lbl.Text = i
        CSSUtils.SetStyleProperty(lbl, "-fx-padding", "0 0 0 20") '<-------
        t.Initialize("", Array(lbl))
        Dim t2 As TreeTableItem
        t2.Initialize("", Array(i))
        t.Children.Add(t2)
        TreeTableView1.Root.Children.Add(t)
    Next
End Sub

1603867168263.png
 
Upvote 0
Top