Link to home
Start Free TrialLog in
Avatar of kago
kago

asked on

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

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);
           fishThread.start();
Then the individual panel should run the game loop
@Override
    public void run() {        
        initializeGame();        
        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??
Avatar of gordon_vt02
gordon_vt02

Does it run on your computer if you run it outside of the IDE?
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
Avatar of kago

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of kago
kago

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of kago

ASKER

I could use $12.95
Avatar of kago

ASKER

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

ASKER

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?