jPanel2.setLayout(new FlowLayout());
jButton1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
jPanel2.add(new JLabel("1111"));
}
});
jpanel2不能实时更新button的添加事件
我要把窗口最小话后再点开,才能看到点击button后添加在jpanel2上的label ,这是为什么
button swing
validate()