W wleupold Member Licensed User Longtime User Dec 16, 2013 #1 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
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 Dec 16, 2013 #2 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
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.
W wleupold Member Licensed User Longtime User Dec 17, 2013 #3 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
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
agraham Expert Licensed User Longtime User Dec 17, 2013 #4 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. Code: Copy 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: Dec 17, 2013 Upvote 0
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. Code: Copy 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))
W wleupold Member Licensed User Longtime User Dec 17, 2013 #5 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
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
agraham Expert Licensed User Longtime User Dec 17, 2013 #6 There are no currently no events for JFXtrasNumberUpDown. I think I can add some but I need to learn more of the JavaFX architecture before I try. Upvote 0
There are no currently no events for JFXtrasNumberUpDown. I think I can add some but I need to learn more of the JavaFX architecture before I try.