Search:

Type: Posts; User: pbrockway2

Page 1 of 20 1 2 3 4

Search: Search took 0.40 seconds.

  1. Replies
    2
    Views
    67

    Re: Find node method, within binary tree

    Maybe (very likely) I'm missing something, but your public method returns an instance of Node. So, aren't you giving the caller access to the internal nodes? And you say find() is a private method,...
  2. Replies
    2
    Views
    49

    Re: Vector pair in java

    In general you would look around the Java API documentation for likely looking classes. But don't forget the "builtin" types of Java. Especially the collection classes are quite extensive, so use...
  3. Replies
    3
    Views
    69

    Re: Grade in Switch Statement :P

    Did you read the section in Oracle's Tutorial about the if statement? What happened when you tried using an if statements?
  4. Replies
    3
    Views
    69

    Re: Grade in Switch Statement :P

    You could use if statements.

    The fact that you only have 6 classifications out of 100 marks suggests if statements to me. For instance, suppose the exams and tests etc added up to 1000 instead of...
  5. Re: creat backspace button in my keyboard ((GUI))

    Read about Manipulating Characters in a String in Oracle's Tutorial. You can find the index of the end of the string with the length() method in the String class.
  6. Replies
    1
    Views
    99

    Re: Operators (Assignments)

    Operators (The Java™ Tutorials > Learning the Java Language > Language Basics)
  7. Replies
    2
    Views
    82

    Re: Hello, World!

    Hi Alesto, welcome to the forums!

    Your English is excellent. Forum discussions are a good way to get fluent with language as well as offering another way to learn about Java. I look forward to...
  8. Re: creat backspace button in my keyboard ((GUI))

    Break what you want to do into a number of smaller steps:

    * Create a button (call it something descriptive, not button37)
    * Add the action listener to the button
    * Add code to the action...
  9. Re: Beginner quiz question static confusion.

    public void think ()
    {
    System.out.printf("At think() x=%d y=%d%n", x, y);
    x++;
    y++;
    System.out.printf("Leaving think() x=%d y=%d%n", x, y);
    }
  10. Replies
    6
    Views
    106

    Re: Lol why isn't my code working?

    Use a switch statement. Small point, but I don't see the user entering a value for a anywhere.

    I agree with Norm: both your variable names and what you choose as method names should be...
  11. Replies
    6
    Views
    106

    Re: Lol why isn't my code working?

    I've corrected the tags:



    public boolean appearsGood() {

    // remember to indent!
    return tagsUsed;}
  12. Re: Problem with return statement in method

    Variables in Java are only defined in the block where they are declared. By block I mean code enclosed in braces, {...}. You declare word in the try block so it's not useable after that block has...
  13. Replies
    3
    Views
    51

    404 and 500 errors

    I'm getting 404 errors whenever I try to look at threads. Is anyone else? or is this just me?

    Not Found
    The requested URL /jpf-moderators/ was not found on this server.
    Additionally, a 404 Not...
  14. Replies
    9
    Views
    111

    Re: Array assignment problem

    StringBuilder is a useful type every time we want to mutate strings. By mutate I mean change the underlying sequence of characters. A typical "homework" example of this would be a hangman program...
  15. Replies
    9
    Views
    111

    Re: Array assignment problem

    Yes. The other link is to the List API and the methods it lists are pretty straightforward (I think). get() and add() look useful.
  16. Replies
    9
    Views
    111

    Re: Array assignment problem

    It means the compiler was expecting an array (because you had used [] perhaps?) but you supplied an instance of ArrayList.

    As explained in the first link of #4 wih lists (eg ArrayList) you set and...
  17. Re: Comparing bitmap pixel data to BufferedImage

    Yes - my question was just wondering out loud whether the writing (painting) of the polygon was respecting the tranparency. This depends on the state of the Graphics context (gf in your code, I...
  18. Replies
    9
    Views
    111

    Re: Array assignment problem

    Yes. The easy way to to use a list (ArrayList or LinkedList) rather than an array. The List interface includes a toArray() method if you really want an array once you have added the lines to it.
    ...
  19. Re: Comparing bitmap pixel data to BufferedImage

    I've never heard of this before, so I've just googled and may be missing something...

    You calculate the score by adding up the color difference between each gene's pixels and the image pixels. ...
  20. Replies
    9
    Views
    111

    Re: Array assignment problem

    I think you are misunderstanding the compiler's message. The scope of students extends from where it is declared (String[] students) to the end of the students() method. Ie, including all of the...
  21. Re: Abstract classes game development - Lists and repeating code?

    I'm glad you've got it working, but the following caught my eye..



    An alternative is to have a separate class know about the totality of created Pickup instances and work with them in whatever...
  22. Re: Trying to make a collider, help would be much appriciated

    if (P.playerX >= Xmin && P.playerX <= Xmax)
    {
    if (P.playerY == Ymin || P.playerY == Ymax)


    This checks if the x-coord is between the supplied values, but it only checks if the y-coord is...
  23. Replies
    2
    Views
    135

    Re: How to represent a chain of moves?

    It sounds like the moves form elements in a tree. The various possible next moves are stored along with the data describing a move itself. What you are calling the "different variations" of a move...
  24. Re: Null Point Exception Error while calling a method

    According to the stack trace you posted the NullPointerException occured on line 49. (Or, at least, the first place your code is mentioned in a stack trace is a very good place to begin looking...) ...
  25. Replies
    4
    Views
    81

    [SOLVED] Re: I need help with timers

    Perhaps there is something in input.update() or render(), or vector.add() that is causing "lastValue != (int) vector.getX()" to become false, or throwing an exception. Who knows? The methods and...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4