import java.util.*;
import java.awt.*;
import java.awt.event.*;
class WindowWithTextArea2 extends Frame{
TextArea text1=new TextArea("enter the OK button "),
text2=new TextArea("the words will come here");
Button btn1=new Button("OK");
String str1=new String("Ah~if you clicked the button,I will Disapeared");
BorderLayout border;
WindowWithTextArea2(String s){
super(s);
add(text1,BorderLayout.EAST);
add(text2,BorderLayout.WEST);
add(btn1,BorderLayout.SOUTH);
btn1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
str1=(text1.getSelectedText());
text2.append(str1);
}
});
setBounds(200,200,600,480);
setVisible(true);
validate();
};
}
public class p211_5{
public static void main(String args[]){
WindowWithTextArea2 window2=new WindowWithTextArea2("挑单词");
}
}<PIXTEL_MMI_EBOOK_2005>2 </PIXTEL_MMI_EBOOK_2005>
java程序设计基础教程第二版: p211_5
最新推荐文章于 2019-03-18 23:40:56 发布