我做了一个项目,显示了一个商店的库存库存。
在该清单中,软件应该将产品的数据与其图像一起存储。
有一个问题...
Bcz的大量股票,图像正在加载屏幕上花了很多时间。
所以,我想我应该给框架中的标签上会显示“加载软件”。
但现在当我设置可见=真的框架,但bcz的图像屏幕类加载问题我的框架无法正确显示。我已经把screen shot,现在我的代码。框架显示问题
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();
}
如何在这种情况下显示一些消息,其他类正在加载或“加载软件”类的东西。
只为知道....这个类不是屏幕上的图像将加载。