Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    pseudo code:

    int val = get a value from user into a local variable
    if(test if val is good) {
    savedVal = val; // save the good value
    }else {
    tell user input was bad. leave savedVal as...
  2. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    I said: Use separate variables for getting the values and for drawing the rectangle.
    Read the user's values into local variables, test the values are in range, then copy those variable's values...
  3. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    height = Integer.parseInt(heightField.getText());
    width = Integer.parseInt(widthField.getText());

    Don't use height and width here. Use another variable that you can test to be in range. Then...
  4. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    Use separate variables for getting the values and for drawing the rectangle.
    Validate the given values first. If ok, set the values used for drawing.
    Otherwise leave the old values as is.
  5. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    There seems to be the sizes of two things to worry about. The applet and the rectangle.
    It used to be that the applet's size was determined by the width and height attributes in the applet tag.
    Can...
  6. Thread: Applet

    by Norm
    Replies
    16
    Views
    1,931

    Re: Applet

    If the sizes entered by the user are out of bounds, display an error message and ignore the invalid values.

    Are you trying to control the size of the applet in the browser's window or the size of...
Results 1 to 6 of 6