?
Solved

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

Posted on 2011-10-23
10
Medium Priority
?
405 Views
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);
           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??
0
Comment
Question by:kago
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 37037829
Does it run on your computer if you run it outside of the IDE?
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 37037838
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
0
 

Author Comment

by:kago
ID: 37048458
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Accepted Solution

by:
kago earned 0 total points
ID: 37141704
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.
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 37141730
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.
0
 

Author Closing Comment

by:kago
ID: 37166523
I could use $12.95
0
 

Author Comment

by:kago
ID: 37141952
I only meant to enter a comment, not submit as answer
0
 

Author Comment

by:kago
ID: 37142518
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?

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

840 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