有段代码,几个小时前还能正确的编译,可现在再编译时就提示
"cannot access JPanel". 郁闷啊!!!
为了测试一下是不是其他地方错了,我特意写了一个简单的代码:
import java.awt.* ;
import javax.swing.* ;public class JPanelText extends JApplet {
public void init() {
JPanel panel = new JPanel() ;
JButton button = new JButton("button") ;
}
}
在编译时还是会提示"cannot access JPanel",全部的显示如下:
D:\practice\java\swing\JPanelText.java:6: cannot access JPanel
bad class file: D:\practice\java\swing\JPanel.java
file does not contain class JPanel
Please remove or make sure it appears in the correct subdirectory of the classpath.
                JPanel panel = new JPanel() ;
                ^
1 errorProcess completed.其他不带JPanel的程序都能正确通过。
各位支招吧,急等!!!