示例#1
0
 public void itemStateChanged(ItemEvent e) {
   Object source = e.getItemSelectable();
   if (e.getStateChange() == ItemEvent.DESELECTED) {
     myAgent.leaveCommunity(((JCheckBox) source).getText());
   } else {
     myAgent.joinCommunity(((JCheckBox) source).getText());
   }
 }
示例#2
0
 void communityChange(boolean b, String name) {
   if (b) myAgent.joinCommunity(name);
   else myAgent.leaveCommunity(name);
 }