在Java中如何从输入对话框中输入字符

2024-11-30 11:56:04
推荐回答(2个)
回答1:

package lesson;

import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextArea;

public class test extends Frame
{
TextArea textA;
test(String s)
{
super(s);
setLayout(new FlowLayout());
textA = new TextArea(10,10);
add(textA);
setSize(300,300);
setVisible(true);
validate();
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
test s = new test("我爱记单词");
}

}

回答2:

能说具体点么?