|
错误信息:
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:97)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:106)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
源码:
private void jbInit() throws Exception {
setIconImage(Toolkit.getDefaultToolkit().createImage(Frame3.class.getResource("logo.gif")));
contentPane = (JPanel) getContentPane();
contentPane.setLayout(borderLayout1);
this.setJMenuBar(jMenuBar1);
setSize(new Dimension(400, 300));
setTitle("主菜单");
jMenu1.setText("sdfsd");
jMenuItem1.setText("ssdfsdf");
jMenuItem2.setText("sdf");
jMenuItem3.setText("sd");
jMenuItem4.setText("sdfsdf");
jMenuBar1.setOpaque(false);
jMenuBar1.add(jMenu1);
jMenu1.add(jMenuItem1);
jMenu1.add(jMenuItem2);
jMenu1.add(jMenuItem3);
jMenu1.add(jMenuItem4);
} |
|