当前位置: 技术问答>java相关
我的程序编译时提示找不到class,什么地方有啊?
来源: 互联网 发布时间:2015-08-03
本文导语: 源代码开始处如下: import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import java.swing.*; 编译提示如下: E:JavaImageViewerImageViewer.java:5: package java.swing does not exist import java.swing.*; ^ E:JavaImageViewerImag...
源代码开始处如下:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.swing.*;
编译提示如下:
E:JavaImageViewerImageViewer.java:5: package java.swing does not exist
import java.swing.*;
^
E:JavaImageViewerImageViewer.java:19: cannot resolve symbol
symbol : class JFrame
location: class ImageViewerFrame
class ImageViewerFrame extends JFrame
^
E:JavaImageViewerImageViewer.java:81: cannot resolve symbol
symbol : class JLabel
location: class ImageViewerFrame
private JLabel label;
^
E:JavaImageViewerImageViewer.java:11: cannot resolve symbol
symbol : class JFrame
location: class ImageViewer
JFrame frame=new ImageViewerFrame();
^
E:JavaImageViewerImageViewer.java:14: cannot resolve symbol
symbol : variable JFrame
location: class ImageViewer
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
^
E:JavaImageViewerImageViewer.java:23: cannot resolve symbol
symbol : class JMenuBar
location: class ImageViewerFrame
JMenuBar menuBar=new JMenuBar();
^
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.swing.*;
编译提示如下:
E:JavaImageViewerImageViewer.java:5: package java.swing does not exist
import java.swing.*;
^
E:JavaImageViewerImageViewer.java:19: cannot resolve symbol
symbol : class JFrame
location: class ImageViewerFrame
class ImageViewerFrame extends JFrame
^
E:JavaImageViewerImageViewer.java:81: cannot resolve symbol
symbol : class JLabel
location: class ImageViewerFrame
private JLabel label;
^
E:JavaImageViewerImageViewer.java:11: cannot resolve symbol
symbol : class JFrame
location: class ImageViewer
JFrame frame=new ImageViewerFrame();
^
E:JavaImageViewerImageViewer.java:14: cannot resolve symbol
symbol : variable JFrame
location: class ImageViewer
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
^
E:JavaImageViewerImageViewer.java:23: cannot resolve symbol
symbol : class JMenuBar
location: class ImageViewerFrame
JMenuBar menuBar=new JMenuBar();
^
|
没有java.swing这个包,用 javax.swing。