请帮忙。 起码也么把出错提示贴出来啊.这样看src.麻烦之极啊! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有两处错误,更改如下: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"); } } 如何阻止 exe4j 生成 error.log? 数组相加怎么写 帮我解决xalan转换的问题,非常谢谢大家 ant的一个问题 JDK1.5中的泛型通配符 谁能给我解析一下有关音频、视频编码格式!或是提供些相关资料 一个显示年月日的javascript问题 What method call is used to tell a thread that it has the opportunity to run? 人性到哪里去啦? 哪里有Visual Age For Java下载呀,帮帮忙,告诉我,谢谢了! 求救!!问个异常基本问题~ 请帮忙。
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");
}
}