• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting Title Frame  RSS feed

 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to set a title for my swing notepad which could open before loading of application.
Could yoiu please suggest me which class should i need to work with.
Thanks in advance.
Rashid Ali
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do u mean can open before loading the application?
 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example MS Word title screen which appear before opening up the application.
Please suggest.
Rashid Ali
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think it is just a dialog they made andopened it while the application is loading.
u can do the same.
make a dialog and open it up before u setisible(true) your application.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you have to do is make a graphic for your title screen, put that graphic in a JLabel (as an ImageIcon), put that label in a JWindow, and you have your splash screen. (Splash screen is usually the preferred term for the intro window that pops up before the full application... title is confusing, because each frame has a title at the top...).

In the constructor of your window, or in the main() method that is launching it, you can do the following - Construct the JWindow splash screen and make it visible. Then construct your real application and set it visible. Then set the splash screen invisible and dispose of it.

-Nate
 
Daniel Searson
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a tip - use a normal AWT Window for your popup loading window. From my testing, the AWT Window loads a lot quicker than the Swing JWindow so your loading screen gets up faster.
I've found that when using a JWindow, the main program frame will be ready by the time your loading screen is (unless you have a large amount of initialization to do) and the purpose of the loading screen (to give some feedback to the user) is lost.
Make sure that you only use AWT components (like Labels not JLabels) on your Window though!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!