thomas908
asked on
Progress Bar
I have main method which contains the follwoing code
if (loginIns.isValidUser()) {
//Instantiate the Splash Screen after successfull login
SplashScreen s = new SplashScreen(Image.getIcon ("icon"), new Frame());
logger.info("Validated");
AD.getInstance();
A.initData();
//initialises all the PanelControllers
PFactory.getInstance().ini tialise();
Fer.getInstance();
// .. number of other things are instantiated
UserInterfaceManager uiManager = new UserInterfaceManager();
Util.setAppFrame(uiManager );
uiManager.initialize();
// close Splash Screen
s.closeSplashScreen();
}
Under the Splash Screen i want to display a progress bar which automatically closes when the splash screen closes (that is the application loads).
How can i do this?
plz help
if (loginIns.isValidUser()) {
//Instantiate the Splash Screen after successfull login
SplashScreen s = new SplashScreen(Image.getIcon
logger.info("Validated");
AD.getInstance();
A.initData();
//initialises all the PanelControllers
PFactory.getInstance().ini
Fer.getInstance();
// .. number of other things are instantiated
UserInterfaceManager uiManager = new UserInterfaceManager();
Util.setAppFrame(uiManager
uiManager.initialize();
// close Splash Screen
s.closeSplashScreen();
}
Under the Splash Screen i want to display a progress bar which automatically closes when the splash screen closes (that is the application loads).
How can i do this?
plz help
Should the progress bar not close automatically when it finishes?
ASKER
>> Should the progress bar not close automatically when it finishes?
Yes it should
Yes it should
it will close once u close the window.
if you are adding the progress bar to splashscreen, when the splash screen closes, progressbar will also close.
So what's the problem? You do not know how to create a JProgressBar?
some example
http://javaalmanac.com/egs/javax.swing/ProgMon.html
http://javaalmanac.com/egs/javax.swing/ProgMon.html
This should help: http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
Note that if you start any processes from a GUI (i.e. via an actionListener, etc.) during the time that the progress bar is monitoring, they'll need to be started in a separate thread.
Note that if you start any processes from a GUI (i.e. via an actionListener, etc.) during the time that the progress bar is monitoring, they'll need to be started in a separate thread.
Beaten... :(
ASKER
>> if you are adding the progress bar to splashscreen, when the splash screen closes, progressbar will also close.
How to add progress bar to splash screen?
splash screen is a image
:(
How to add progress bar to splash screen?
splash screen is a image
:(
What is this class: SplashScreen
You should add the progress bar in there.
You should add the progress bar in there.
>> splash screen is a image
You mean your splash screen mainly *contains* an image.
It's probably a JPanel/JDialog in which you can add your progress bar.
(Probably BorderLayout, with the image in the CENTER and the progress bar in the SOUTH)
You mean your splash screen mainly *contains* an image.
It's probably a JPanel/JDialog in which you can add your progress bar.
(Probably BorderLayout, with the image in the CENTER and the progress bar in the SOUTH)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> How to add progress bar to splash screen?
> splash screen is a image
Use a JLabel to display your image, and either add your progress bar to the panel containing the label or to the label directly depending on where you want it to appear.
> splash screen is a image
Use a JLabel to display your image, and either add your progress bar to the panel containing the label or to the label directly depending on where you want it to appear.
ASKER
Thanks You so much
ASKER
sorry typo ;)
*Thank You so much
*Thank You so much
Thank you for accepting :)