Hi all,
It can easily be very confusing when trying to add a Spinner Control... At least it is for me...
The following solution (Thanks to Robert Linn's excellent site) works great:
However, in my project I have 1 TabPane with 4 TabPages. I'm trying to make the Spinner Control visible only in TabPage 2.
How can I achieve that?
Added:
The following solution does not report any error but on the other hand the Spinner Control is not visible:
TIA,
Dennis
It can easily be very confusing when trying to add a Spinner Control... At least it is for me...
The following solution (Thanks to Robert Linn's excellent site) works great:
B4X:
'SpinnerTextField defined as JavaObject:
Private joSpinner As JavaObject
'Add a SpinnerTextField to the RootPane
Sub AddSpinner
Dim spMin As Double = 0
Dim spMax As Double = 10
Dim spInitialValue As Double = 5
Dim spAmountToStepBy As Double = 1
joSpinner.InitializeNewInstance("javafx.scene.control.Spinner", Array(spMin, spMax, spInitialValue, spAmountToStepBy))
MainForm.RootPane.AddNode(joSpinner, 20, 100, 100, 20)
End Sub
However, in my project I have 1 TabPane with 4 TabPages. I'm trying to make the Spinner Control visible only in TabPage 2.
How can I achieve that?
Added:
The following solution does not report any error but on the other hand the Spinner Control is not visible:
B4X:
Sub Add_Spinner
Dim spMin As Double = 1
Dim spMax As Double = 500
Dim spInitialValue As Double = 1
Dim spAmountToStepBy As Double = 1
joSpinner.InitializeNewInstance("javafx.scene.control.Spinner", Array(spMin, spMax, spInitialValue, spAmountToStepBy))
Dim Spinner As Pane
Spinner.Initialize("Spinner")
Spinner.RemoveNodeFromParent
Spinner.AddNode(joSpinner, 130, 320, 60, 30)
End Sub
TIA,
Dennis
Last edited: