Search:

Type: Posts; User: Bill_H

Page 1 of 2 1 2

Search: Search took 0.24 seconds.

  1. Re: Need help understanding GUI screen layouts and labels

    Thanks for the help you two! I have the outlay I'm looking for, now I have another problem I've run into: my buttons don't appear to be working correctly.

    I've started writing my method to convert...
  2. Need help understanding GUI screen layouts and labels

    Ok, I have to make a program which converts binary to decimal and decimal to binary, making my own calculations for it. That part is no problem, but right now I'm trying to construct the basic layout...
  3. Re: Having problems with String out of bounds errors

    Sorry for the delay, and thanks for the advice. I was able to get it to work, for the most part.

    Now I have the problem that when multiple spaces are detected within the array, it seems to leave...
  4. Having problems with String out of bounds errors

    Ok, well I am making a program which takes input, changes all multiple blanks into a single blank space, and creates a new line after a sentence is declared. A sentence will be declared by finding...
  5. Replies
    11
    Views
    11,153

    Re: Convert CHAR to STRING

    Oh I'm sorry, I forgot the class.


    gender = Character.toString(sex);

    Now it should work.
  6. Replies
    11
    Views
    11,153

    Re: Convert CHAR to STRING

    You're in luck. Being that a string is of the String class and not a primitive variable, it has it's own methods, one of them being the toString() method. Just input the char as the parameter and it...
  7. Replies
    11
    Views
    22,258

    Re: Scanner vs BufferedReader?

    Ok, that all makes sense now. Thanks a lot to everyone!
  8. Replies
    11
    Views
    22,258

    Re: Scanner vs BufferedReader?

    Ok, that makes sense. So unless I'm doing something with reading files, I can use BufferedReader to accept the input, as long as that input is generated by the user, such as entering numbers or text,...
  9. Replies
    11
    Views
    22,258

    Re: Scanner vs BufferedReader?

    So, Scanner is better in the sense that it allows more specific operations to be done. And BufferedReader is more of a generic catch all, which seems to me more like a class that would be taught in...
  10. Replies
    11
    Views
    22,258

    Re: Scanner vs BufferedReader?

    Thanks for the comment. I guess I'll keep using Scanner then. Probably easier than learning a whole new class anyway to accomplish the same tasks with a class I already know.
  11. Replies
    11
    Views
    22,258

    Scanner vs BufferedReader?

    I was just curious as to why I see many people in this forum using BufferedReader over the Scanner class? I don't believe I've heard of it before I came here, I've just always used the Scanner class....
  12. Replies
    8
    Views
    1,387

    Re: Need help with loop

    No problem, glad I could help!
  13. Replies
    5
    Views
    1,653

    Re: If Statement Java Need help

    You're welcome!

    As for part 4, I'm not entirely certain how your program works since I'm not the one making it, and just reading it doesn't always immediately click into place, but I'm guessing...
  14. Replies
    6
    Views
    663

    Re: Possible regex problem?

    That's alright, a string would also work, but in this case I believe a single character input would limit the amount of possible errors and outcomes. In theory string will work though, as long as you...
  15. Replies
    8
    Views
    1,387

    Re: Need help with loop

    Try defining them both right before the do while loop.


    boolean repeat = false; // A value is necessary
    char response

    Then remove the char in front of response within the loop.
  16. Replies
    8
    Views
    1,387

    Re: Need help with loop

    It's usually best to let someone learn on their own and just guide them than give them the answer, jeremykatz.

    But in response to your question, the only import you would need is for the Scanner...
  17. Replies
    5
    Views
    1,653

    Re: If Statement Java Need help

    Ok, right here I notice that you have the program return a king at value 13, but at 13 or greater it returns not a card. Shouldn't this be greater than 13 like:


    else if(faceValue==13) {
    ...
  18. Thread: 2d Array

    by Bill_H
    Replies
    1
    Views
    924

    Re: 2d Array

    Well, once you have a basic understanding of 2d arrays, the rest of the program is just a bunch of if/else if statements and nested for loops.

    As for a starting point, I'd recommend finding a good...
  19. Replies
    8
    Views
    1,387

    Re: Need help with loop

    The easiest way I've found to loop a program is to use a do while loop around the entire thing. What you have is the original program, then a duplicate inside an if statement (which by the way needs...
  20. Replies
    5
    Views
    1,653

    Re: If Statement Java Need help

    You have a "{" which never closes on the first if statement on line 27.


    27. if(faceValue == 1) {
    28. return "Ace";
    29. }
    30. else if(faceValue==2) {
    31. return "Two"; ...
  21. Replies
    5
    Views
    3,361

    Re: Repeating program issue

    That did it! Thanks a lot! We haven't covered recursion yet, though I've skimmed the chapter, so now I know what to do in the case of returning and repeating a method. Thanks again!
  22. Replies
    6
    Views
    663

    Re: Possible regex problem?

    Sure! At the moment I've only got two methods, the one I was asking about in this thread, and you may notice the other one from my other thread, chronoz13. At the time of posting this, I have altered...
  23. Replies
    5
    Views
    3,361

    Re: Repeating program issue

    Yeah, I had originally use a String variable, but to reduce the amount of possible outcomes, I changed it to a char so only the first character of the text input will be read, and it allows me to use...
  24. Replies
    5
    Views
    3,361

    Repeating program issue

    I need to get a method in my CommonUse class to work properly with any other class. What I'm aiming for is to use this particular method in future programs for school without having to rewrite the...
  25. Replies
    6
    Views
    663

    Re: Possible regex problem?

    Thanks! Learn something new every day :)
Results 1 to 25 of 26
Page 1 of 2 1 2