What I try to do is to help the OP find the problem and solve it. That takes a few more steps and time.
Type: Posts; User: Norm
What I try to do is to help the OP find the problem and solve it. That takes a few more steps and time.
Sorry, you gave him the answer without helping him debug the code and find what the problem was = spoon feeding.
@vigneshwaran
Which do you think is a good way to help a beginner learn to solve programming problemns?
Find his problem and give him the solution. AKA spoonfeeding
or
Help the OP find what...
Does it print BEFORE the user enters anything in the text field?
Please answer this question:
Can you see the printed output before the user enters anything?
Are you printing the value AFTER the user has entered some data?
Can you see the printed output before the user enters anything?
Immediately after the variable gets a value assigned to it.
Assign variable a value
print value of the variable
Try debugging the code by adding a println that prints out the value that returned by the getText() method so you can see what the code is doing.
Is the code getting the value BEFORE the user enters...
Assign it a value (for example: "") when it is defined.
What happens if you remove the variable: name1 and use deliveryName instead?
Where is the code that shows that the value of the variable is null?
Why use the variable: name1? Why not use deliveryName?
Please post the full code (in code tags) so we can see where things are defined.
Make sure the variable definition is in scope (within same pair of {}s) where you are using it.