62,634
社区成员




//你的代码结构有问题
//bframe=new bb(); 这句去掉
public void actionPerformed(ActionEvent e){
if(e.getSource()==b)
num=Integer.parseInt(t.getText());
else
new bb().setVisible(true); //这么改,点另一窗口时,才new bb()
//你提前把 bb new出来的话,你怎么弄显示的都是0
//不要在构造函数里做那么多操作。楼主自己再好好想想吧
}
}
public class test{
public static void main(String args[]){
new aa();
//new bb(); 这里去掉 ,创建bb对象
}
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == b)
bframe.t.setText(t.getText()); // 这里调整一下就行了
else
bframe.setVisible(true);
}