Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

Run one class and then anther.  RSS feed

 
dan Ranity
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Question i have just made a splash screen class and it all works perfect. i also have anther class which is my game class. Now i just want to know how do i make it so when the user runs the game class in the main function it will run that splash screen class first and then run the game class?
Just to explain if you did not understand as my english is not to good:
I have two classes. One is called Splash and anther is called game . Now the user will run that game class by ruining the main method. Now what i want to happen when the main method is ran i want the splash class first to run so it shows the splash screen and then for the game class to run straight afterwards. I have both classes working but not sure how to get around this problem. Thanks again
 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Dan,

First of all splash screens, something that comes up while the program is loading and initializing are not usually done that way.

I posted this little tutorial for NetBeans users but most of it is pretty general.

If you're going to do it by first displaying a dialog with your splash, give the user some time to appreciate it then close it automatically the best way is probably to use a Swing Timer the Oracle tutorial is pretty good. Have the timer fire maybe once a second and after I don't know 15 seconds close it and continue.

Good luck,

Joe
 
dan Ranity
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
quick question will this work in programs such as blueJ
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not create, multiple posts, for essentially the same question. Did you check out the link Paul provided here?
Locking this thread. Let us continue the discussion in your original topic http://www.coderanch.com/t/609977/GUI/java/Java-gui-splashscreen
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!