Explorar o código

Fix SwarmSize dont change.

Tom Troppmann %!s(int64=5) %!d(string=hai) anos
pai
achega
39784f73af
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/exampleAlgorithms/PSOAlgotihm.java

+ 1 - 1
src/exampleAlgorithms/PSOAlgotihm.java

@@ -211,7 +211,7 @@ public class PSOAlgotihm implements Algorithm {
 		JFormattedTextField swarmSizeTextField = new  JFormattedTextField(integerFormatter);
 		swarmSizeTextField.setValue(swarmSize);
 		swarmSizeTextField.setToolTipText("Only positive Integer.");
-		swarmSizeTextField.addActionListener(actionEvent -> swarmSize = Integer.parseInt(swarmSizeTextField.getValue().toString()));
+		swarmSizeTextField.addPropertyChangeListener(actionEvent -> swarmSize = Integer.parseInt(swarmSizeTextField.getValue().toString()));
 		swarmSizeTextField.setBounds(125, 60, 50, 20);
 		parameterPanel.add(swarmSizeTextField);