How do I make this splash screen display a progress bar on top of the loaded image at a specific X,Y position?
Posted on 2006-10-27
I have a component class that I have take from several threads I found on this site. I need to overlay a JProgressBar on the image that is loaded, and a JLabel so that I can provide text saying what the startup process is doing. I have tried to accomplish this using ZIndexing but it doesnt work. Also how do I statically set the X,Y positions of the ProgressBar and the Jlabel? Can someone tell me how to get the desired effect out of this code?
Worth 500 points.
* Created on October 28, 2006, 12:18 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
* @author Rick
public class JSplash extends JWindow
/** Creates a new instance of JSplash */
public JSplash(String filename, Frame f)
JLabel l = new JLabel(new ImageIcon(filename));
progress = new JProgressBar();
Dimension screenSize =
Dimension labelSize = l.getPreferredSize();
setLocation(screenSize.width/2 - (labelSize.width/2),
screenSize.height/2 - (labelSize.height/2));
screenSize = null;
labelSize = null;