[此贴子已经被作者于2006-2-28 12:41:47编辑过]
[此贴子已经被作者于2006-12-7 17:10:50编辑过]
public class Singleton{private static Singleton s=new Singleton();private Singleton(){}public static Singleton getSingleton(){return s;}}
我找到了,楼上的给错了,不过谢谢了
public class Fra extends JFrame(){private static Fra f=null;
private Fra(){
this.setsize(400,300);
this.setvisible(true);
}
public static Fra my(){
if(f==null){
f=new Fra();
return f
}}