Search:

Type: Posts; User: why_always_me

Search: Search took 0.10 seconds.

  1. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    Hi so i tried using if statements to set my rNum variable and it never changes from 0? any ideas?



    public void readStartFile(String fileName){
    int rNum=0;
    int cNum=0;
    ...
  2. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    Hi I have now found out how to use the split method correctly. here is my piece of code used for an example as you suggested.


    public class SplitExample{

    public static void main(String...
  3. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    managed to get jdk 7 working now. still slightly confused by the split() method though. is there any easier way of detecting the R,C and colour?

    thanks
  4. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    sorry i am not too sure :(. Can not get any code to compile on my laptop at the minute after trying to install jdk 7. no matter what program i try and run i just get the error could not find or load...
  5. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    i removed the bottom line strLine.removeCharAt(strLine[0]);
    and it compiles fine.
  6. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    ok so it should be something like



    while ((strLine = br.readLine()) != null) {
    strLine.split(" ");
    strLine.removeCharAt(strLine[0]);

    }
  7. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    ok thanks. so would that mean i would do something like



    while ((strLine = br.readLine()) != null) {
    strLine.split(" ");
    strLine = strLine.substring(0,...
  8. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    Hi I will be determining the correct square by trying to parse the row and column info from the file as well as the colour and then using



    buttons[row][col].setBackground(colour)


    where row...
  9. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    Hi I have managed to get the colouring in part to work :) but i am now confused on how to do the file reading. below is the new code that colours squares and SHOULD fill some in from the start. the...
  10. Replies
    20
    Views
    2,596

    Re: Java programme to colour in a grid

    Hi ok thanks for that. I have now managed to get the squares to change colour. How will i now make them go back to default if they are clicked and they have been coloured in? thanks

    here is the...
  11. Replies
    20
    Views
    2,596

    Java programme to colour in a grid

    Hi this is my first post here.

    basically i want a programme to do teh following:

    1)create a 6x6 grid.
    2)ask the user to choose from 6 colours to fill a square
    3)test to see if one row or...
Results 1 to 11 of 11