hw16_13.java
来自「java的一些关于多线程」· Java 代码 · 共 30 行
JAVA
30 行
import java.awt.*;
import java.awt.event.*;
public class hw16_13 extends Frame
{
static hw16_13 frm=new hw16_13();
static TextArea txa1;
static TextArea txa2;
public static void main(String args[])
{
txa1=new TextArea("",6,10,TextArea.SCROLLBARS_NONE);
txa2=new TextArea("",6,10,TextArea.SCROLLBARS_NONE);
frm.setSize(200,150);
frm.setTitle("Text Event");
frm.setLayout(new FlowLayout(FlowLayout.CENTER));
txa1.addTextListener(new textval());
txa2.setEditable(false);
frm.add(txa1);
frm.add(txa2);
frm.setVisible(true);
}
static class textval implements TextListener
{
public void textValueChanged(TextEvent e)
{
txa2.setText(txa1.getText());
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?