在我的程序中,我想用启动画面启动它几秒钟,然后启动程序的第一帧......
但是有2个问题。
首先出现启动画面,但本应在其中显示的照片没有出现
第二,当飞溅结束时,第一帧开始了,但它没有。
这是我的代码.....所以我需要知道问题出在哪里?
public class Splash extends JWindow {
    AbsoluteLayout absoluto;
    AbsoluteConstraints absimage,absrra;
    ImageIcon Image;
    JLabel jlabel;
    JProgressBar Barra;
    public Splash(){
         absoluto=new AbsoluteLayout();
         absimage = new AbsoluteConstraints(0,0);
         absrra = new AbsoluteConstraints(0,410);
         jlabel=new JLabel();
         Image=new ImageIcon("sales.png");
         jlabel.setIcon(Image);
         Barra=new JProgressBar();
         Barra.setPreferredSize(new Dimension(410,10));
         this.getContentPane().setLayout(absoluto);
         this.getContentPane().add(jlabel,absimage);
         this.getContentPane().add(Barra,absrra);
         new  Thread(){
             public void run(){
                 int i=0;
                 while(i<101){
                     Barra.setValue(i);
                     i++;
                     try {
                         sleep(30);
                     } catch (InterruptedException ex) {
                       //  Logger.getLogger(Splash.class.getName()).log(Level.SEVERE,null,ex);
                     }
                 }
                 System.exit(0);
             }
         }.start();
         this.pack();
         this.setLocationRelativeTo(null);
         this.setVisible(true);
    }
    public static void main (String args[]) throws SQLException, ClassNotFoundException{
        new Splash();
        loginForm a =new loginForm();
        a.setTitle("fram 1");
        a.setSize(700,600);
        a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        a.setLocationRelativeTo(null);
        a.setVisible(true);
    }
}