My Java game works fine inside IDE, but doesn't work right outside IDE

Posted on 2011-10-23
Last Modified: 2013-11-24
I'm using netBeans IDE 7.0 to program a multi-thread card game. I started off easy with go fish and war, then moved up to cribbage and eventually more logically advanced games. The main window opens and you can choose an internal frame to play each game.
public class MainWindow extends javax.swing.JFrame { ...

The internal frames are seperate classes
public class cribbagePanel extends javax.swing.JInternalFrame implements Runnable{

I run each selected game from the main window as a thread
Thread fishThread = new Thread(fishPnl);
Then the individual panel should run the game loop
    public void run() {        
        while(status != fishStatus.GAMEOVER){ ...

Each individual game starts and runs the same way. My problem is inside the IDE, the games all run fine. When I try it on another computer, the game loop just seems to stop at random times. To distribute the game, I run the .jar file created in the dist folder. I include the dist folder on the new machine. I even tried to upgrade the machine's java to the latest version and it still doesn't work.
I want to program at least 2 more card games to this program, but if I can't distribute it, I'm not going to waste my time.
My question is how come the program works fine inside the IDE, but not on another machine??
Question by:kago
    LVL 10

    Expert Comment

    Does it run on your computer if you run it outside of the IDE?
    LVL 10

    Expert Comment

    Also is this zoned properly?  Is it a J2ME program or a desktop application?  Should it be in the GIS/GPS Programming zone at all?

    Might want to change zones to:

    - Java Programming Language
    - Netbeans
    - Game Programming

    Author Comment

    No, the program doesn't work properly on my machine either. It works somewhat. It starts up and you can play for a while, but then at random intervals, the game loop just seems to stop. Also, sometimes it takes 3 clicks to  activate a jButton.

    Accepted Solution

    I can't believe what a waste of money this was. I ended up spending hours troubleshooting it myself. The correct advice would have been to run the java file from the command prompt. any errors would show up in the command window. Then, I knew what was causing the program errors. Thanks for nothing EE.
    LVL 10

    Expert Comment

    And I quote:

    "Does it run on your computer if you run it outside of the IDE?"

    Forgive me if that only implied running from the command line.

    Author Closing Comment

    I could use $12.95

    Author Comment

    I only meant to enter a comment, not submit as answer

    Author Comment

    Well gordon_vt02, it took 4 days and an admin comment before anyone finally commented, then you left a comment asking if the program works outside the ide.  I left my comment saying no, it doesn't , etc... and no comments followed.  I specifically paid $12.95 to get help with this one problem. I'm  sorry if I sound disappointed. I really would have appreciated a follow up comment. I've been a member here since 2003 and I've had a bunch of problems solved and I've always been grateful for EE, but I am extremely disappointed with the response I received for this problem. Fortunately, I STUMBLED on the fact that I can watch errors while running the program from the command prompt, otherwise I still would not know I misspelled eightOfDiamonds.gif. I can forgive you for only implying running from the command line, but where were the follow up comments?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    Performance issue while iterating with streams 5 34
    allStar challenge 1 27
    python question 5 36
    python sqlite question 11 21
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    This video teaches viewers about errors in exception handling.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now