继承了Frame后,怎么在Dialog中指定Frame对象?
importjava.awt.*;publicclassTextextendsFrame{publicvoidmyFrame(){Dialogjd=newDialog(F...
import java.awt.*;
public class Text extends Frame{
public void myFrame(){
Dialog jd=new Dialog(Frame,"提示消息",true);
jd.setBounds(300,200,300,200);
jd.setVisible(true);
} 展开
public class Text extends Frame{
public void myFrame(){
Dialog jd=new Dialog(Frame,"提示消息",true);
jd.setBounds(300,200,300,200);
jd.setVisible(true);
} 展开
推荐于2016-01-16
展开全部
this 就是当前实例了。。。。。。。。。
import java.awt.*;
public class Text extends Frame{
public void openDialog(){
Dialog jd=new Dialog(this,"提示消息",true);
jd.setBounds(300,200,300,200);
jd.setVisible(true);
}
import java.awt.*;
public class Text extends Frame{
public void openDialog(){
Dialog jd=new Dialog(this,"提示消息",true);
jd.setBounds(300,200,300,200);
jd.setVisible(true);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询