Search:

Type: Posts; User: Norm

Search: Search took 0.15 seconds.

  1. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    What I try to do is to help the OP find the problem and solve it. That takes a few more steps and time.
  2. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Sorry, you gave him the answer without helping him debug the code and find what the problem was = spoon feeding.
  3. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    @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...
  4. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Does it print BEFORE the user enters anything in the text field?
  5. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Please answer this question:
    Can you see the printed output before the user enters anything?
  6. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Are you printing the value AFTER the user has entered some data?
    Can you see the printed output before the user enters anything?
  7. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Immediately after the variable gets a value assigned to it.

    Assign variable a value
    print value of the variable
  8. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    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...
  9. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Assign it a value (for example: "") when it is defined.
  10. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    What happens if you remove the variable: name1 and use deliveryName instead?
  11. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Where is the code that shows that the value of the variable is null?

    Why use the variable: name1? Why not use deliveryName?
  12. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Please post the full code (in code tags) so we can see where things are defined.
  13. Replies
    32
    Views
    3,120

    Re: Having trouble storing variable from JTextField

    Make sure the variable definition is in scope (within same pair of {}s) where you are using it.
Results 1 to 13 of 13