Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    You should use the equals() method for comparing Strings, not the == operator.
  2. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Cross posted at connecting json read method to textfield in class
  3. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Its done in a method. You call methods to do some job or task.
    One or more methods are contained in a class.
  4. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    When you call the method that is reading/getting the String pass the variable: textField as a parameter.
    theReadMethod(textField); // pass textField to the method
    In the method that is doing the...
  5. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    You could pass a reference to the textfield to the method that is reading the data and it could use that reference to put a String into the textfield.
  6. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Yes you could create a method (not a class) that you can call with the line number you want it to read and return.
  7. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Yes that sounds like the way to do it.

    You can use the Scanner class's nextLine() method to read the lines from the file.
  8. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Can you read the lines of the text file, one after the the other?
    Can you parse the data on each line into separate tokens using split?
    Can you convert a String to a number using an Integer class...
  9. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Have you solved your problem?
    Or do you have more questions or problems?
    Please explain what you are having problems with.
  10. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    Please explain in more detail.
    Are you trying to pick a line by its position in the file? In that case you need to read over all the lines that precede the desired line until you get to the line...
  11. Replies
    25
    Views
    4,451

    Re: reading and witing to txt file

    If the lines have tokens/words separated by spaces, you could use the String class's split method to create an array with all the tokens.
Results 1 to 11 of 11