Search:

Type: Posts; User: Norm

Page 1 of 20 1 2 3 4

Search: Search took 0.52 seconds.

  1. Re: problem with my jcombobox error java.lang.ArrayIndexOutOfBoundsException: -1

    Use an if statement to make sure the value is in range:


    if (value >= 0 && value < length) { // check value in range
    // ok to use value as index
    ... use value here
    }


    You did...
  2. Re: problem with my jcombobox error java.lang.ArrayIndexOutOfBoundsException: -1

    The code should test that the value being used is valid (0 to length-1) and not use it if it is not valid.
  3. Re: problem with my jcombobox error java.lang.ArrayIndexOutOfBoundsException: -1

    Please post the code here on the forum. Be sure to wrap the code in code tags.

    Did you look at the line where the error happens? What variable has the value of -1?
  4. Re: problem with my jcombobox error java.lang.ArrayIndexOutOfBoundsException: -1

    You left off an important part of the error message that shows what line the exception happened at.

    Look at the line where the exception happened and try to figure out why the index was -1.

    If...
  5. Re: Is it possible to convert a Java program to an Android app?

    It can be done. I've converted several PC programs to Android. The GUI is completely different and needs to be completely redesigned and rewritten. The background processing code can mostly be...
  6. Thread: Java Test Failing

    by Norm
    Replies
    20
    Views
    290

    Re: Java Test Failing

    public Integer getInventory_count() {
    return inventory_count;
    }
    The code shows that the method returns the value in inventory_count. Where is a value given to that variable?


    I...
  7. Thread: Java Test Failing

    by Norm
    Replies
    20
    Views
    290

    Re: Java Test Failing

    Can you post the code for the getInventory_count() method and any other methods that control the value it returns so we can see where the value it returns is computed?
  8. Re: Android Studio, Java, compare EditText[] with a String[]

    Have you tried debugging the code by displaying the contents of the two variables(array elements) so you can see what the computer sees when it executes the code?
    Add some println() statements to...
  9. Thread: Java Test Failing

    by Norm
    Replies
    20
    Views
    290

    Re: Java Test Failing

    If the value returned by the getInventory_count() method is wrong, you need to look at the code in the method to see how it is computing the wrong value. Does the code in the method need to be...
  10. Re: how to make text label change, depending on text area value?

    Are you sure? Any difference means they are not equal.
  11. Thread: Java Test Failing

    by Norm
    Replies
    20
    Views
    290

    Re: Java Test Failing

    Is it that the getInventory_count() method returns the wrong value? Have you looked at the code and tried to debug it to see why it is not returning the correct value?
  12. Thread: Java Test Failing

    by Norm
    Replies
    20
    Views
    290

    Re: Java Test Failing

    What variable has the unexpected value?

    How is the code executed? What program is used?
  13. Replies
    3
    Views
    146

    Re: Fails to encrypt and decrypt a string

    Your IDE must be hiding the compiler errors. I don't use the same IDE as you do and can not explain to you how to have your IDE show you the compiler errors.

    I use the javac command to compile...
  14. Replies
    3
    Views
    146

    Re: Fails to encrypt and decrypt a string

    There are compiler errors in the code that need to be fixed before you try to execute it.

    Copy the full text of the compiler's error messages and paste it here if you need help fixing the errors.
  15. Replies
    3
    Views
    117

    Re: Client Server Chat Code

    That's an unusual display for a runtime error. The normal stack trace gives the source line number for where the error happened. How are you executing the program?

    Here is an example of the...
  16. Replies
    6
    Views
    188

    Re: if statement on set method

    The java program executes statements in the order that they are placed in a program.
    If code is in a method and that method is never called, the code in the method will not be executed.
    If code...
  17. Replies
    6
    Views
    188

    Re: if statement on set method

    The java program or jvm that executes the statements in your program.
    The statement(s) that assigns a value to the variable: tax must be executed for the value of tax to change. If it is not...
  18. Replies
    6
    Views
    188

    Re: if statement on set method

    Is the code that sets the value of the variable: tax executed? If not its value will not change from the default.
  19. Replies
    4
    Views
    241

    Re: Problem with the exception

    Remove the method that is defined as returning void from the String concatenation expression.
  20. Replies
    1
    Views
    247

    [SOLVED] Re: Problem to refer to codes

    Please copy the text of any error messages and paste them here.
  21. Replies
    9
    Views
    132

    Re: logical error in my App

    Send a datagram packet for the receive() to read.
  22. Replies
    9
    Views
    132

    Re: logical error in my App

    Read the API doc for the method. It should say if that method will block.
  23. Replies
    9
    Views
    132

    Re: logical error in my App

    Does the receive() method block waiting for input?
  24. Replies
    9
    Views
    132

    Re: logical error in my App

    What is the value of the variable that controls the loop? Does it have the correct value for the loop to start executing? Add a println() statement to print its value so you can see.
  25. Replies
    3
    Views
    162

    Re: how to fill a field online?

    Also posted at: how to fill a field online?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4