Frame Showing Problem
Posted
by Nitz
on Stack Overflow
See other posts from Stack Overflow
or by Nitz
Published on 2010-05-24T06:01:55Z
Indexed on
2010/05/24
6:30 UTC
Read the original article
Hit count: 442
Hey Guys
I have made one project which is showing the inventory of the stock of one store.
In that inventory the software should store data of the products with their images.
There is one problem...
Bcz of the lots of stock, the screen on which is image is loading taking a lot of time.
So, i thought i should give the frame in which there will be on label which will show the "Loading Software".
But now when i am setting visible = true for that frame, but bcz of that images screen class loading problem my frame is not showing correctly. I have put screen shot, now my code.
JFrame f;
try{
f = new JFrame("This is a test");
f.setSize(300, 300);
Container content = f.getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
JLabel jl = new JLabel();
jl.setText("Loading Please Wait....");
content.add(jl);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}catch(Exception e){
e.printStackTrace();
}
initComponents();
try {
addInverntory = new AddInventoryScreen();
showstock = new showStock(); // this class will take big time.
mf = new mainForm();
f.setVisible(false);
}catch (Exception ex) {
ex.printStackTrace();
}
How Can show some message that, other class is loading or "Loading Software" kind of thing in this situation.
Just For the know....this class is not screen on which the image will load.
© Stack Overflow or respective owner