• Post Reply Bookmark Topic Watch Topic
  • New Topic

restarting an application

 
Jaime Caetano
Ranch Hand
Posts: 32
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey, I'm going trough this problem maybe someone can help me so we're creating this board game ffor this school java project and at the end of the game I made this pop up that shows 2 buttons, one saying exit... other sayin keep playing when i press keep playinng, I want to restart the application...

that means exiting gameGUI and exiting gameLogic and creating new gameLogic to pass to gameGUI, that's what my method main is doing...

any tips?

Thank you Jaime
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe instead of recreating the objects you can add "init" methods to them, which reset all the data to to its original state. Those methods could also be called when the objects are first instantiated at startup.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!