java复习题新.ppt

* public void init() { text = new JTextField(10); panel = new JPanel(); setSize(200, 100); setLayout(new GridLayout(2,1)); add(text); add(panel); text.addActionListener(this); } public void actionPerformed(ActionEvent e) { if (e.getSource() == text) { r = Integer.parseInt(text.getText()); repaint(); } } } 在文本框中输入一个整数, 在面板中画一个直径为输入 整数的圆块 5.9.阅读下列程序,请写出该程序的功能。 import java.io.*; public class Test5_9 { public static void main(String args[]) { int i, n = 10; int a[] = new int[10]; FileReader file; BufferedR

文档评论(0)

1亿VIP精品文档

相关文档