起码也么把出错提示贴出来啊.
这样看src.麻烦之极啊!

解决方案 »

  1.   

    有两处错误,更改如下:import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;public class spalshwindow extends JWindow implements Runnable,ActionListener
    {
    Thread splashthread=null;
    JProgressBar progress;
    public spalshwindow()
    {
    JPanel spalsh=new JPanel(new BorderLayout());
    URL url= getClass().getResource("winter.jpg"); if (url!=null)
    {
    spalsh.add(new JButton(new ImageIcon(url)),BorderLayout.CENTER);
         }
         progress=new JProgressBar(1,100);
     progress.setStringPainted(true);
     progress.setBorderPainted(false);
     progress.setString("Plase wait.....");
     progress.setBackground(Color.white);
     spalsh.add(progress,BorderLayout.SOUTH);
     setContentPane(spalsh);
     pack();
    }
    public void start()
    {
    splashthread=new Thread(this);
    splashthread.start();
    }
        public void run()
     {
    show();
    try{
    for (int i=0;i<=100 ; i++)
    {   Thread.sleep(100);
                    progress.setValue(progress.getValue()+1);
    }
    setVisible(false);
    }catch (Exception e)
     {  e.printStackTrace();}
     dispose();
    }
     
    public   static  void showframe(String title)
    {
      JFrame frame=new JFrame();
      JPanel p=new JPanel();
      JButton button=new JButton("OK");
      JTextArea text=new JTextArea();
      Container cp=frame.getContentPane();
          cp.setLayout(new BorderLayout());
      cp.add(text,BorderLayout.CENTER);
      p.setLayout(new BorderLayout());
      p.add(button,BorderLayout.CENTER);
      cp.add(p,BorderLayout.SOUTH);
         button.addActionListener(new spalshwindow()); //改动
     frame.setBounds(0,0,600,600);
     // frame.setSize(400,600);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
      try{
      Thread.sleep(11000);
      frame.show();
      }catch(Exception e)
    { e.printStackTrace();}
        
      
    }
    public void actionPerformed(ActionEvent e)
    {
    if (e.getSource()  instanceof JButton) //改动
    {
    System.exit(0);
    }
    }
       
       public static void main(String args[])
    {
               spalshwindow  spalsh=new spalshwindow();
       spalsh.start();
       showframe("lihua");
    }
    }