startAssociator();
stopAssociator();
  public AssociationsPanel() {    // Connect / configure the components    m_OutText.setEditable(false);    m_OutText.setFont(new Font("Monospaced", Font.PLAIN, 12));    m_OutText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));    m_OutText.addMouseListener(new MouseAdapter() {      public void mouseClicked(MouseEvent e) {	if ((e.getModifiers() & InputEvent.BUTTON1_MASK)	    != InputEvent.BUTTON1_MASK) {	  m_OutText.selectAll();	}      }    });    m_History.setBorder(BorderFactory.createTitledBorder("Result list"));    m_AssociatorEditor.setClassType(Associator.class);    m_AssociatorEditor.setValue(new weka.associations.Apriori());    m_AssociatorEditor.addPropertyChangeListener(new PropertyChangeListener() {      public void propertyChange(PropertyChangeEvent e) {	repaint();      }    });    m_StartBut.setToolTipText("Starts the associator");    m_StopBut.setToolTipText("Stops the associator");    m_SaveOutBut.setToolTipText("Save the selected associator output to a file");    m_StartBut.setEnabled(false);    m_StopBut.setEnabled(false);    m_SaveOutBut.setEnabled(false);    m_StartBut.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	startAssociator();      }    });    m_StopBut.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	startAssociator();      }    });    m_SaveOutBut.addActionListener(new ActionListener() {	public void actionPerformed(ActionEvent e) {	  saveBuffer();	}      });    // Layout the GUI    JPanel p1 = new JPanel();    p1.setBorder(BorderFactory.createCompoundBorder(		 BorderFactory.createTitledBorder("Associator"),		 BorderFactory.createEmptyBorder(0, 5, 5, 5)		 ));    p1.setLayout(new BorderLayout());    p1.add(m_CEPanel, BorderLayout.NORTH);    JPanel buttons = new JPanel();    buttons.setLayout(new GridLayout(2,2));    JPanel ssButs = new JPanel();    ssButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));    ssButs.setLayout(new GridLayout(1, 2, 5, 5));    ssButs.add(m_StartBut);    ssButs.add(m_StopBut);    buttons.add(ssButs);    JPanel vPl = new JPanel();    vPl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));    vPl.setLayout(new GridLayout(1,1,5,5));    vPl.add(m_SaveOutBut);    buttons.add(vPl);        JPanel p3 = new JPanel();    p3.setBorder(BorderFactory.createTitledBorder("Associator output"));    p3.setLayout(new BorderLayout());    final JScrollPane js = new JScrollPane(m_OutText);    p3.add(js, BorderLayout.CENTER);    js.getViewport().addChangeListener(new ChangeListener() {      private int lastHeight;      public void stateChanged(ChangeEvent e) {	JViewport vp = (JViewport)e.getSource();	int h = vp.getViewSize().height; 	if (h != lastHeight) { // i.e. an addition not just a user scrolling	  lastHeight = h;	  int x = h - vp.getExtentSize().height;	  vp.setViewPosition(new Point(0, x));	}      }    });        GridBagLayout gbL = new GridBagLayout();    GridBagConstraints gbC = new GridBagConstraints();    JPanel mondo = new JPanel();    gbL = new GridBagLayout();    mondo.setLayout(gbL);    gbC = new GridBagConstraints();    gbC.anchor = GridBagConstraints.NORTH;    gbC.fill = GridBagConstraints.HORIZONTAL;    gbC.gridy = 1;     gbC.gridx = 0;    gbL.setConstraints(buttons, gbC);    mondo.add(buttons);    gbC = new GridBagConstraints();    gbC.fill = GridBagConstraints.BOTH;    gbC.gridy = 2;     gbC.gridx = 0; gbC.weightx = 0;    gbL.setConstraints(m_History, gbC);    mondo.add(m_History);    gbC = new GridBagConstraints();    gbC.fill = GridBagConstraints.BOTH;    gbC.gridy = 0;     gbC.gridx = 1;    gbC.gridheight = 3;    gbC.weightx = 100; gbC.weighty = 100;    gbL.setConstraints(p3, gbC);    mondo.add(p3);    setLayout(new BorderLayout());    add(p1, BorderLayout.NORTH);    add(mondo, BorderLayout.CENTER);  }