Search:

Type: Posts; User: pbrockway2

Page 1 of 20 1 2 3 4

Search: Search took 0.33 seconds.

  1. Replies
    1
    Views
    7

    Re: Date validation not working.

    Please format your code so that it's readable.



    public boolean appearsGood() {

    // remember to indent!
    return tagsUsed;}
  2. Replies
    6
    Views
    48

    Re: Locking the camera on character

    @OP: I'm sure I'm not the only one who would like to help, but I don't have a clue what org.newdawn.slick.* is. A link would be good, and it might clarify what a "camera" etc is.

    Also good APIs...
  3. Replies
    2
    Views
    36

    Re: Code for knapsack problem

    (1) The general idea is to catch the InputMismatchException and when you've caught it break out of whatever loop you are using to get the user's data.



    What did you try? It would help if you...
  4. Re: Cannot figure out how to write this function

    It's quite common to see lists dealt with using lots of recursion, and no loops in sight! Far from being complex, the correctness of the code tends to jump out at you. #3 was supposed to be a hint,...
  5. Replies
    3
    Views
    85

    Re: Print certain amount of multiples

    You're welcome.
  6. Re: Cannot figure out how to write this function

    The tail is a list consisting of everything *except* the head. Calling it multiple times you end up with the empty list, not the head.

    In fact I was assuming you wanted a purely recursive...
  7. Replies
    8
    Views
    96

    Re: Roman to ordinary number conversion

    Hi archijava_19, do you see the problem people are having with what you are saying? If you can't use any methods, then all you have left to work with are the +,-,*,/ and % operators. But the only...
  8. Re: I cannot restore database in JAVA. HELP!

    So, it's not your code...

    That blog and it's author would be the best place to ask. Don't forget to say you can't restore your database with that code. Ie, what happens when you try.

    Reading...
  9. Replies
    3
    Views
    85

    Re: Print certain amount of multiples

    Although you have to implement printFirstKMultiples(fac,num) it might pay to consider implementing a different method: printMultiples(fac,from,to) which prints the multiples of fac from from*fac...
  10. Re: Cannot figure out how to write this function

    An aside, while I think about the question, as choices of variable name l, l0 and o suck. If the code was given to you by your teacher feel free to pass that opinion on.

    [Edit] An interleaved...
  11. Re: I cannot restore database in JAVA. HELP!

    Is that intended? Or should it have an = like the other arguments?
  12. Re: Quick questions before I start learning.

    A good question.

    There are others better qualified than me to say, but I get the feeling that computer programmers tend to break down tasks into discrete components that have to be executed in a...
  13. Re: Quick questions before I start learning.

    define: API

    The Java compiler comes with a large API - people will often refer to them as the "standard classes" or similar. There are other APIs you can download, but you won't require them to...
  14. Re: Convention question: how to manage imports?

    I'm not a professional and I don't live in the real world (or so my "friends" tell me) but I think lots of import package.ActualClass are just fine.

    The thing is they make your code literate: they...
  15. [SOLVED] Re: HW Problem using for loops and if else statements

    You're welcome. I'm glad you've got it calculating x properly. By the way short variables are not such a good idea - especially l which looks too much like 1. len is only a couple more keystrokes!
  16. Replies
    3
    Views
    71

    [SOLVED] Re: Method header for file names?

    Also at java-forums.org.

    Please, if you are going to start a discussion a multiple places, post a link at each of them to all of the others. That way everybody taking part in the discussion knows...
  17. Replies
    3
    Views
    71

    [SOLVED] Re: Method header for file names?

    By "method header" do you mean javadoc?


    /**
    * Returns a file specified by the user. The user will be repeatedly prompted
    * until they specify a file that does exist.
    *...
  18. Replies
    2
    Views
    69

    Re: help with printf

    Also the Javadocs for the java.util.Formatter class. There's a lot to digest but it follows a long tradition from C and carries over to other languages. Learn little bits as necessary and bookmark...
  19. Re: how do I change the JLabel text by clicking on the JButton?

    There's nothing wrong in principle, with buttons having each their own handlers. This is the approach you might take when the buttons are doing unrelated things. Of course, as posted, the handlers...
  20. Replies
    3
    Views
    89

    Re: Seriously Whats wrong with my code

    You're welcome. I'm glad you've got it sorted out.
  21. Re: how do I change the JLabel text by clicking on the JButton?

    This compiler message means that you declared your BorderLayoutJFrame class to implement the ActionListener interface. In that case it must have a "public void actionPerformed(ActionEvent e)" method...
  22. Re: how do I change the JLabel text by clicking on the JButton?

    OK. That message means that the compiler doesn't know what an ActionListener is. You can tell it by adding



    import java.awt.event.ActionListener;
    at the start of the file.

    In general you...
  23. Re: how do I change the JLabel text by clicking on the JButton?

    I'm not completely sure what you mean by "not working". I'm guessing that it compiles but, at runtime, clicking a button results in no change to the button's text. (Say if I'm wrong. I don't have...
  24. Re: how do I change the JLabel text by clicking on the JButton?

    Thanks for editing your post.

    Did you read the link? It's quite long and starts by discussing listeners generally before a section that deals with action listeners specifically.
  25. [SOLVED] Re: HW Problem using for loops and if else statements

    You use the loop to calculate what value x should have. Ie you (a) declare x before the loop then (b) inside the loop increment x when and only when you see a mismatch.

    You don't print any...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4