大家好,又见面了,我是你们的朋友全栈君。
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
import java.awt*;
import java.awt event*;
class ABC implements ActionListener,WindowListener
{
Button b1;
Button b2;
Text Pield showing;
public void action performed(Action Evente)
{if(e.get Source()==b1)
{showing.set Text(“名字”);
}
else if(e,get Source()==b2)
{showing.set Text(” “);
}
}
public void window Opened(Window Event e){}
public void window Closed(Window Event e){}
public void window Iconified(Window Event e){}
public void window Deiconified(Window Event e){}
public void window activated(Window Event e){}
public void window Deactivated(Window Event e){}
public void window Closing(Window Event e){}
{system.exit(0);}
void go()
{Frame Fr=new Frame(“text”);
b1=new Button(“确定”);
b2=new Button(“取消”);
Showing=new TextField(20);
fr.setlayout(new FlowLayout());
fr.setsize(300,300);
fr.add(b1);
fr.add(b2);
fr.add(showing);
fr.setvisible(ture);
b1.add Avtion Listener(this);
b2.add Avtion Listener(this);
fr.add Window Listener(this);
}
public static void main
string [] arg()
{
ABC a=new ABC()
a.go();
}
}
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/156495.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...