Search:

Type: Posts; User: Norm

Page 1 of 2 1 2

Search: Search took 0.09 seconds.

  1. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    For debugging, you should use System.out.println() to print the contents of the programs variables and to show program flow so you can understand what the program is doing and be able to change it to...
  2. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    By println I meant: System.out.println(<put stuff here that is to be printed>);
    These will print on the console.
  3. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Try debugging the code by adding some println statements that print out the values of the variables that control the logic and to show the execution flow so you can see what the computer sees and...
  4. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Did you look at the API doc for the class to see if there are any methods that will do what you want?
  5. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Try debugging the code by adding some println statements to print out the values of the variables that are a problem every time their values are changed so you can see what the program is doing and...
  6. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    How can the value of question (a reference to a JLabel) be the same as q1 (a reference to a String)?

    The text displayed in a JLabel is a String. You could get that String and compare it to the...
  7. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    A JLabel is not a String and a String is not a JLabel. It does not make sense to test if they are equal.

    Can you explain what the conditions in those if statements are supposed to be testing?
  8. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    What line was that error on?

    Use the javac command's -Xlint option to see what the problem is. My javac commandline from when I compile a program:
    D:\Java\jdk1.6.0_29\bin\javac.exe -Xlint ...
  9. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    You had a choice of two places to change.
    You changed one and it caused many errors, so that is not the right place to change.
    Try changing the other place.

    Read the tutorial about how to define...
  10. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    int[] sizeCost = {SMALL,MEDIUM,LARGE,XLARGE};
    Please read post #36 again about arrays and methods. That is a definition for an array, not for a method. The error message says there is a missing...
  11. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Where is the method: sizeCost() defined? The compiler can not find it.
  12. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Please reread my last post #36.
  13. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Does it exist anywhere?

    Please post the full text of the error message that shows the source line where the error happens.

    A method and an array are different things.
    To index an array the...
  14. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Very close. You have to make it an array by adding the []s:

    int[] sizeCost = {SMALL,MEDIUM,LARGE,XLARGE};
  15. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Where is the method: sizeCost() defined? The compiler can not find its definition.

    The method is passed the index to the sizeBox combo box. Given that index, it could index into an array that...
  16. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Where is the pizza's size determined? How can/does the program get the size?
    When it gets the size, how does it get the cost?
    Where is the output that the cost should be added to?
  17. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Is the program working now?
  18. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Where are they defined? Are they in scope (within the same pair of {}s) as where they are being referenced?
  19. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Look at the code before the line with the error.
  20. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    K:\CompSci\Projects\JMyNewHome.java:102: error: ')' expected
    if(aspen.isSelected()
    ^
    The error message says what is wrong. The compiler wants a ) above the ^...
  21. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Please copy the full text of the error messages and post them here.
  22. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    You need to set the contents of the textfield AFTER the user has selected a checkbox.
    The posted code calls setText() BEFORE the user has done anything.
  23. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Have a separate variable for the currently selected price for each category.
    When a checkbox is selected update the price for its category, sum the prices for each category and display it.
  24. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Look at the GridLayout layout manager. Put each row of components into a container and add that container to the layout.
  25. Replies
    59
    Views
    5,397

    Re: Beginner help please.

    Can you describe in a list of steps what the code in the action listener should do?
    I don't understand the logic that is used there.

    To see what values are set by the java program, add some...
Results 1 to 25 of 30
Page 1 of 2 1 2