Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    You should use the equals() method do compare Strings not the == operator.
  2. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    Use the substring method to get parts of a String.
  3. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    The split() method would be the easiest.
    Other choices would be the indexOf and substring methods.

    To see what split() does, try writing a 3 line program with a sample input String. Call the...
  4. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    What happens to the value returned by the split() method?
  5. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    Not yet. You are still ignoring what the split method returns.

    Did what you posted compile? Try compiling before posting to see if the compiler likes your code.
  6. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    You should read the API doc for the String class to see how to use its methods.
    For example the split method returns a value that you will use. Your code ignores what is returned.
  7. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    You could use the String class's split method on the input String, then use the substring method on each substring to remove the leading R or C character. Then use the Integer class's parse method to...
  8. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    How do you determine the "correct" square to color?
  9. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    When do you want them to go back to the default? Is it when some event happens?
  10. Replies
    20
    Views
    2,604

    Re: Java programme to colour in a grid

    Please Edit your post and wrap your code with
    <YOUR CODE HERE> to get highlighting

    Look at using a JDialog to prompt the user for his choices.

    Putting the button objects in an arraylist might...
Results 1 to 10 of 10