Search:

Type: Posts; User: thatguy

Search: Search took 0.33 seconds.

  1. [SOLVED] Re: Tile puzzle game getting tiles to move (help)

    I think i do,
    but what i posted before does what you have asked I believe.

    1 2 3 4
    5 6 7 8
    9 10 11 #
    13 14 15 12
    Enter a number: 12

    The user enter the number 12. so the if statement should...
  2. [SOLVED] Re: Tile puzzle game getting tiles to move (help)

    public void move(int tileNumber) {
    if (!isValid(tileNumber)) {
    return;
    }

    for (int r = 0; r < boardSize; r++) {
    for (int c = 0; c < boardSize;...
  3. [SOLVED] Re: Tile puzzle game getting tiles to move (help)

    Here an example

    you enter in 12 and the move method will switch the 12 with the empty space like so.

    1 2 3 4
    5 6 7 8
    9 10 11 #
    13 14 15 12

    but if you enter 12 again it i will not...
  4. [SOLVED] Tile puzzle game getting tiles to move (help)

    I am building a class called TilePuzzle and it is a text base game and it looks like this.

    1 2 3 4
    5 6 7 8
    9 10 11 12
    13 14 15 #

    The way I programmed the move method it looks...
  5. Thread: JColorChooser

    by thatguy
    Replies
    8
    Views
    271

    [SOLVED] Re: JColorChooser

    Thanks again for all your help.
  6. Thread: JColorChooser

    by thatguy
    Replies
    8
    Views
    271

    [SOLVED] Re: JColorChooser

    I really appreciate all your help, thank you.

    but now when I choose a color it doesn't change the color of the circle.



    class AddColor implements ActionListener {
    ...
  7. Thread: JColorChooser

    by thatguy
    Replies
    8
    Views
    271

    [SOLVED] Re: JColorChooser

    I agree and that is what I did at first I put the repaint() right after the color change like this





    class AddColor implements ActionListener {
    @Override
    ...
  8. Thread: JColorChooser

    by thatguy
    Replies
    8
    Views
    271

    [SOLVED] Re: JColorChooser

    Thank you for the help. but now i'm confused on why this works. I called repaint which calls the paintComponent method but repaint is in the paintComponent method? so how does that work?



    ...
  9. Thread: JColorChooser

    by thatguy
    Replies
    8
    Views
    271

    [SOLVED] JColorChooser

    I can't seem to get the circle to change color after the user picks a new color from the JColorChooser. any ideas?




    package bouncer;

    import java.awt.BorderLayout;
    import java.awt.Color;...
  10. Re: question about getting data from the console

    OMG i'm so sorry i must of made a mistake when i was testing it. everything works fine thanks for all your help.
  11. Re: question about getting data from the console

    API parseInt: "Parses the string argument as a signed decimal integer"
  12. Re: question about getting data from the console

    I thought Integer.parseInt(candyNum[i]) would change the string to a int?
  13. Re: question about getting data from the console

    Thanks for the idea. But now i cant figure out why the numbers are still strings. any ideas




    Scanner userInput = new Scanner(System.in);
    ArrayList<Integer> candy = new...
  14. question about getting data from the console

    I'm trying to fill an arraylist with number but I don't want the user to have to press enter after each number. I would like it if they could put all the numbers on one line separated by white space...
  15. Replies
    1
    Views
    321

    please help solve this question

    I'm not sure if this would even be the right forum to put this in but here it goes. I have this homework my teacher assign us a couple of days ago. I don't need help coding it but i do need help...
  16. [SOLVED] Re: homework troubles, any help would be appreciated

    Thank you guys for responding but I sat down with a my pen and a sheet of paper and did the loop step by step and figured it out and yes I need to add comments. Its something I need to work on.
    ...
  17. [SOLVED] homework troubles, any help would be appreciated

    Homework question: Write a program that prompts the user to enter the diameter of the diamond and the character to use for drawing the diamond and then draws the diamond.

    At the moment I just...
  18. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    Solve, complete code.


    package homework.pkg3part.pkg4;


    import java.util.Calendar;
    import java.util.GregorianCalendar;

    /*
  19. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    Now I'm confused about something else.

    This is the right answer.
    GregorianCalendar birthday = new GregorianCalendar(2012, 5, 7);
    int birthdayWeekday = birthday.get(Calendar.DAY_OF_WEEK);

    or ...
  20. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    I think i figured it out

    cal.set(year, month, dayOfMonth);
    System.out.println("Date: " + cal.getTime().toString());
    cal.add(Calendar.DAY_OF_MONTH, 100);
    ...
  21. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    O.K so i tried three different things

    cal.add(Calendar.DAY_OF_MONTH, 100); // nothing
    cal.add(dayOfMonth, 100); // nothing

    System.out.println("Add 100 days: " +...
  22. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    I think I been asking the wrong question. I knew how to get the information obviously since I did it in my first post. Sorry about that. but is there a way to convert that into a "date type" where I...
  23. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    Thank you. I been looking up and down GregorianCalendar and the calendar API. But i don't see anything that will get the information from my constructor.

    I'm using my constructor to declare my...
  24. Replies
    11
    Views
    1,502

    [SOLVED] Re: GregorianClaendar Class

    Ya i looked at that also but still no luck. I don't understand if I used cal.add(dayOfMonth, 2); but i can't assign it to a variable and I can't print it out so what can i do with it. Sorry I am...
  25. Replies
    11
    Views
    1,502

    [SOLVED] GregorianClaendar Class

    I have having trouble with a program my teacher gave me and I was wondering if someone can point me in the right direction. I have to write a program that prints the following information: The date...
Results 1 to 25 of 25