JBuilder9,有两个窗体:Form1,Form2;Form1为主窗体,Form2为Form1调用的条件查询窗体,怎样在Form2关闭时返回SLQ语句给Form1且Form1自动执行该SQL操作?望指教啊,最好附代码啊!!

解决方案 »

  1.   

    监听componentRemoved事件,在其中调用父container的读取子container的text内容  void this_componentRemoved(ContainerEvent e) {
          ((ParentDialog1)this.getParent()).setText(this.textField.getText());  }ParentDialog1.setText(String) 是把输入的参数记录到它的类的类变量。这样就实现了子窗口与父窗口通信