dbtnNewRadioButton_2 ); group1.add( rdbtnNewRadioButton_3 ); addmessagebutton = new JButton( " 添加" ); addmessagebutton .addActionListener( new addmessagebuttonlistener()); addmessagebutton .setBounds(123, 121, 85, 27); panel_2.add( addmessagebutton ); // 清空按钮,点击时触发清空的事件 clearbutton = new JButton( " 清空" ); clearbutton .addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { if (e.getSource() == clearbutton ) { singbox .setSelected( false ); dancebox .setSelected( false ); webbox .setSelected( false ); footballbox .setSelected( false ); basketballbox .setSelected( false ); volleyballbox .setSelected( false ); xueshibox .setSelected( false ); shuoshibox .setSelected( false ); boshibox .setSelected( false ); qitabox .setSelected( false ); nametext .setText( "" );