Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jason.infra.centralised;
 
 
 import java.awt.Frame;
 
public class KillAgentGUI extends BaseDialogGUI {
    private static final long serialVersionUID = 1L;
    private JList lAgs;
    public KillAgentGUI(Frame fString title) {
        super(ftitle);
    }
    protected void initComponents() {
         = RunCentralisedMAS.getRunner().getEnvironmentInfraTier().getRuntimeServices();
        getContentPane().setLayout(new BorderLayout());
        // Fields
        Vector<StringagNames = new Vector<String>(.getAgentsNames());
        Collections.sort(agNames);
         = new JList(agNames);
        JPanel p = new JPanel(new BorderLayout());
        p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Current agents"..));
        p.add(.);
        getContentPane().add(p.);
        .setText("Kill");
    }
    protected boolean ok() {
        new Thread() {
            public void run() {
                Object[] sls = .getSelectedValues();
                for (int i = 0; i < sls.lengthi++) {
                    String agName = sls[i].toString();
                    .killAgent(agName"KillAgGUI");
                }
            }
        }.start();
        return true;
    }
New to GrepCode? Check out our FAQ X