一看就是学生阶段。。。代码敲错了。。导致编译不了。。对着书仔细看下有没哪里代码敲错了。
兄弟 你的 new.JFrame() new后面怎么跟了 一个点??
//.删去,还有是setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);少了一个a
import javax.swing.JFrame;
public class TestFrame{
public static void main(String[] args){
JFrame frame1= new JFrame();
frame1.setTitle("Windlw 1");
frame1.setSize(200,150);
frame1.setLocation(200,100);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setVisible(true);
JFrame frame2=new JFrame();
frame2.setTitle("Windlw 2");
frame2.setSize(200,150);
frame2.setLocation(410,100);
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setVisible(true);
}
}
new后面错了。
你的程序贴上来看看,new操作符出问题了,对象创建不对~