Results 1 to 4 of 4
  1. #1
    illnin0 is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Default Weird crashes...

    I'm writing a little game in Java but I'm experiencing some weird crashes, that has brought my development to a halt.

    My program is set to run in full screen for 5 sec and then shut down. When i experience the crashes, the shutdown doesn't happen and nothing is drawn to the screen... The program must still be running in the back, cause it keeps making println statements.


    I'm trying to loop through an array and check on different object's current states.

    Java Code:
            
    for(int i = 0; i < IL.insList.length; i++){
        if(IL.insList[i].doTest() == true){ //Always returns true atm
            IL.insList[i].execute();           
            i = 0;                                 
        }

    The strange thing is that my application only crashes when I have more than one object in insList[].

    My InstructionList class looks like this:

    Java Code:
    package testapp;
    
    public class InstructionList {
    
        public InsMove[] insList;
    
        public InstructionList(){
    
            insList = new InsMove[2];
    
            insList[0] = new InsMove();
            insList[1] = new InsMove();
        }
    
    
    }

    My InsMove class looks like this:

    Java Code:
    package testapp;
    
    public class InsMove {
    
    
        public void execute(){
            System.out.println("Working");
    
        }
    
        public boolean doTest() {
            return true;
        }
    
    }
    I really hope someone can help me solve this problem, as I can't seem to locate any errors myself.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Try updating your video hardware driver(s).

    db

  3. #3
    illnin0 is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    Try updating your video hardware driver(s).

    db
    Ok, I can try that... But can you elaborate on why I'd suddenly need updated VC drivers? I have the problem both on my desktop and my laptop. I really wouldn't want people to need super updated drivers just to run my application.

  4. #4
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    This is an infinite loop:
    Java Code:
    for(int i = 0; i < IL.insList.length; i++){
        if(IL.insList[i].doTest() == true){
            IL.insList[i].execute();
           [COLOR="Red"] i = 0; //keeps resetting i to 0[/COLOR]
        }
    }

Similar Threads

  1. Program crashes: NullPointerException
    By d4nce2thisbeat in forum New To Java
    Replies: 5
    Last Post: 11-20-2010, 09:33 PM
  2. Swing GUI crashes (using JNI)
    By divs in forum AWT / Swing
    Replies: 4
    Last Post: 06-10-2010, 08:04 AM
  3. Multithreaded server crashes
    By skarosg3 in forum Threads and Synchronization
    Replies: 7
    Last Post: 05-26-2010, 09:24 AM
  4. Java crashes
    By Nicole in forum Advanced Java
    Replies: 2
    Last Post: 04-06-2009, 07:22 AM
  5. Java Crashes on Mac 10.3.9 not sure how to update
    By patricknowow in forum New To Java
    Replies: 1
    Last Post: 11-30-2007, 03:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •