
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JComboBox;

/**
 *
 * @author mortisjust
 */

public class ReactorSwitchListener implements ActionListener{

    private JComboBox comboBox;

    public ReactorSwitchListener(JComboBox comboBox) {
        this.comboBox=comboBox;
    }

    public void actionPerformed(ActionEvent e) {
       Object o = this.comboBox.getSelectedItem();
       if(o==null){
           System.out.println("No hay listas de Control");
       }else{
           String toQueue = this.comboBox.getSelectedItem().toString();
           System.out.println("Shuting down Reactor: "+ toQueue);
           MsgToReactorControl msg = new MsgToReactorControl(toQueue);
           new Thread(msg,"Control Msg").start();
       }
    }
}
