I have a game developed in Eclipse, and it works great when I run it from there. It gives you a JFrame frame, where you can select difficulty and if you done it, you can play with the game, in a new frame. It worked well, until I created the setup frame.
So in Eclipse, i run the app, i set the setup, click the button, the first frame goes invisible, and this opens the next frame. When executing the exported runnable jar, it doesn't stop, but the second frame (the game frame) is invisible.
Here's the main.
public static void main(String[] args) {
int ammuData = 0;
int enemyData = 0;
Config config = new Config();
while (config.frame.isVisible()) {
ammuData = config.getAmmu();
enemyData = config.getEnemies();
}
Game game = new Game(ammuData, enemyData);
game.frame.setResizable(false);
game.frame.setTitle(Game.title);
game.frame.add(game);
game.frame.pack();
game.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
game.frame.setLocationRelativeTo(null);
game.frame.setVisible(true);
game.start();
}