import javax.swing.*;
public class JFrameDemo {
public static void main(String[] args) {
JFrame frame = new JFrame("add");
JPanel pane = new JPanel();
JLabel label = new JLabel("add");
pane.add(label);
frame.setContentPane(pane);
frame.setSize(450, 500);
frame.setVisible(true);
}
}
这个程序能运行,但是为啥总是JFrame,JPane等行前显示红色小叉???这是错误原因Access restriction: The method setContentPane(Container) from the type JFrame is not accessible due to restriction on required library D:\Java\jdk1.7.0_51\jre\lib\rt.jar。。。如何解决 |
|