B4J Question Set JFXtrasNumberUpDown number to NULL

wleupold

Member
Licensed User
Longtime User
Hi,
I'm new to B4J.
I use a JFXtrasNumberUpDown within a TableView.
Here are my questions:
1. I initialise the control without any value. This works fine. Now I add a value to the control out of a database. How can I set this value programatically to a Null value without initialising the control for new?
2. How can I Change the text Color of this control?

Thanks for helping

Werner
 

agraham

Expert
Licensed User
Longtime User
What do you mean by "Null". If you are talking about MaxValue and MinValue you can't null them as they are primitive double vales.

You can't easily change the text colour. It's probably possible but I don't know enough about styling at the moment. I'm better at doing the abstract stuff rather than UIs.
 
Upvote 0

wleupold

Member
Licensed User
Longtime User
I will give you a short example:
Dim xUpDown AsJFXtrasNumberUpDown
xUpDown.Initialize("xUpDown")
xUpDown.MinValue = 1
xUpDown.MaxValue = 6
xUpDown.Format = "0.00"
xUpDown.Style = "-fx-font-size: 14"
grdInput.Items.Add(ArrayAsObject(WrapNFeld(xUpDown)))
.
.
.
Sub WrapNFeld(txt AsJFXtrasNumberUpDown) AsPane
Dim pn1 AsAnchorPane
pn1.Initialize("")
pn1.AddNode(txt, 0, 0, -1, -1)
pn1.FillHorizontally(txt, 0, 0)
Return pn1
End Sub

As you can see I don't use
xUpDown.number = any number
thus the control is empty (NULL).

Now I fill the control with a number.
If necessary the control should be emptied programatically again.
How can I do this? At the moment I remove the control an intitialize it for new.

Thanks

Werner
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Looking at this I see two things that I missed implementing. I'll add them for the next version of jFXtrasControls but youcan do it with JavaObject in the meantime.
B4X:
Dim Obj As JavaObject
Obj = NumUpDown
' Set the prompt
Obj.RunMethod("setPromptText", Array As Object( "Prompt"))
' Clear the number
Obj = Obj.RunMethod("numberProperty", Null)
Obj.RunMethod("set", Array As Object(Null))
 
Last edited:
Upvote 0

wleupold

Member
Licensed User
Longtime User
Thanks for helping!
There is still another problem:
Programatically I want to calculate some values from the updown.numbers.
That depends if the user does inputs into the control or removes them.
How can I detect if the user perfoms any changes?
Is there an event to the JFXtrasNumberUpDown?

Thanks

Werner
 
Upvote 0
Top