Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Re: Trying to format an Array using specifiers to appear in TextArea

    You need to look at the API doc for the Formatter class to see how to code format Strings.
    The error message says: f is not used to format Strings
  2. Re: Trying to format an Array using specifiers to appear in TextArea

    Looks like you have changed the code. Does the code now assign a value to pData before it is used?

    --- Update ---


    You need to look at the API doc for the Formatter class to see how to code...
  3. Re: Trying to format an Array using specifiers to appear in TextArea

    Can you do the simple thing of adding the println statement so the code looks like this:

    System.out.println("pData="+pData); // print the value of pData BEFORE using it on next line
    pData...
  4. Re: Trying to format an Array using specifiers to appear in TextArea

    Can you post the code that printed the "nu"?
    Did you print the value of pData BEFORE the format() statement was executed?
  5. Re: Trying to format an Array using specifiers to appear in TextArea

    Please copy text and paste it here. Images are too small to read.



    pData = String.format("%8.2f%n", pData);
    What printed out for the value of pData when you printed it BEFORE the above...
  6. Re: Trying to format an Array using specifiers to appear in TextArea

    What value is in pData when it is formatted? Add a println just before the format() statement and print out the value of pData so you can see.
  7. Re: Trying to format an Array using specifiers to appear in TextArea

    What variable has the "nu" String in it? What did you expect to see where the "nu" is shown?
    Is there code that takes the first 2 characters of null?

    The posted code doesn't show the source or...
  8. Re: Trying to format an Array using specifiers to appear in TextArea

    Can you copy the contents of the textarea and paste it here with some comments saying what the problem is with it?
  9. Re: Trying to format an Array using specifiers to appear in TextArea

    Are there error messages? Copy them and paste it here.
  10. Re: Trying to format an Array using specifiers to appear in TextArea

    Insert an end line character: "\n" where you want a line to end and the next part of the String to be on the next line.
Results 1 to 10 of 10