这么把定义的变量添加界面中到
程序代码:
import java.awt.*; import javax.swing.*; public class MyGUI extends Frame{ JButton j1; JLabel l1,l2; JTextField t1,t2; MyGUI() { setLayout(new FlowLayout()); JFrame b=new JFrame(); setBounds(200, 300, 200, 400); setVisible(true); }