Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    That's how a lot of programs progress. They start simple and have features added.
  2. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    What happens when you compile and execute the program? Does it do what it is supposed to do?
  3. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    You need to decide on these questions:
    What is each constructor supposed to do?
    What arguments need to be passed to each constructor?

    When you have answers to those questions, you should be able...
  4. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    That depends on what the class is supposed to do.


    I'm not sure what you are asking. Each class needs some constructors so that it can be used as needed. The number of constructors depends on...
  5. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Yes, that constructor should use the args passed to it to define the values in the object being created.
  6. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    The compiler will pick the constructor that matches the arguments used in the new statement.

    If you want a different constructor to be called, change the arguments in the new statement and add a...
  7. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Did you find what variable had the null value and then change the code so it would not have a null value?


    What size and color is the code using? Where does it get those values from? What...
  8. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Your IDE should help you know which line of a program you are looking at.
  9. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Look at line 124 in the Canvas class, find the variable with the null value and then backtrack in the code to find out why that variable does not have a non-null value.

    Where is the Canvas class...
  10. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    You need to be sure the full text of the error message is displayed by calling the printStackTrace() method in the catch block. The error message will show the line number where the error happened....
  11. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Back tomorrow,
  12. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Read the tutorial on how to write and use constructors.
  13. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Sorry, I don't know what you mean by a line when you are talking about a square.
    What is the "first line" or a second line in a square?


    What you have posted looks like calls to the class's...
  14. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Do you understand what that says? If you want to pass any arguments to the constructor you need to define a constructor to take what you want to pass.


    Can you explain where the first line is? ...
  15. Replies
    31
    Views
    4,328

    Re: Java Programming Blue J 0_o

    Please copy and post the full text of the error message.


    You would need to create a new instance of each of the lines by using the new statement with the class's constructor.


    The variable...
Results 1 to 15 of 15