Cant seem to get LoadLayout to work. I can load a layout by casting back to a Scorllpane:
But loading the layout using B4XVIew crashes::
causes: java.lang.ClassCastException: class javafx.scene.control.ScrollPane cannot be cast to class javafx.scene.layout.Pane (javafx.scene.control.ScrollPane is in module javafx.controls of loader 'app'; javafx.scene.layout.Pane is in module javafx.graphics of loader 'app')
Is casting the B4XView back to Scrollpane the correct way to this?
B4X:
Process_Globals
Private fx As JFX
Private MainForm As Form
Dim JOMainForm As JavaObject
Private scroller As B4XView
Private displaypane As B4XView
Private SP As ScrollPane
Dim InnerPane As Pane
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("scroller") 'Load the layout file.
MainForm.Show
JOMainForm = MainForm
JOMainForm.GetFieldJO("stage").RunMethod("setMaximized", Array(True))
SP = scroller
SP.LoadLayout("Content",800,800)
Log(scroller.ScrollViewInnerPanel)
End Sub
But loading the layout using B4XVIew crashes::
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("scroller") 'Load the layout file.
MainForm.Show
JOMainForm = MainForm
JOMainForm.GetFieldJO("stage").RunMethod("setMaximized", Array(True))
' SP = scroller
' SP.LoadLayout("Content",800,800)
Log(scroller.ScrollViewInnerPanel)
scroller.LoadLayout("Content")
End Sub
causes: java.lang.ClassCastException: class javafx.scene.control.ScrollPane cannot be cast to class javafx.scene.layout.Pane (javafx.scene.control.ScrollPane is in module javafx.controls of loader 'app'; javafx.scene.layout.Pane is in module javafx.graphics of loader 'app')
Is casting the B4XView back to Scrollpane the correct way to this?