各位高手帮忙看一下,关于XXXX.show()的问题
为什么红色部分不显示呢,不是有.show()了吗?还有红色的this代表什么? 编译可以通过,就是运行时点击run无反应。public void actionPerformed(ActionEvent paramActionEvent)
{
String str = paramActionEvent.getActionCommand();
if (str.equals("Set Para")) {
setParameter();
return;
}
if (str.equals("Run")) {
psoRun();
return;
}
if (str.equals("Pause")) {
psoPause();
return;
}
if (str.equals("Stop")) {
psoStop();
return;
}
if (str.equals("Exit")) {
psoExit();
return;
}
}
private void psoExit()
{
super.dispose();
}
private void setParameter()
{
this.initialWeight = this.tfInitialWeight.getText();
this.populationSize = this.tfPopulationSize.getText();
this.iterationMaximum = this.tfIterationMaximum.getText();
this.velocityMaximum = this.tfVelocityMaximum.getText();
this.functionDimension = this.tfFunctionDimension.getText();
if ((this.initialWeight.equals("")) || (this.positionMaximum.equals("")) ||
(this.populationSize.equals("")) || (this.iterationMaximum.equals("")) ||
(this.functionName.equals("")) || (this.functionDimension.equals(""))) {
return;
}
this.bSetParameter.setEnabled(true);
this.bRun.setEnabled(true);
this.bPause.setEnabled(false);
this.bStop.setEnabled(false);
this.bPrint.setEnabled(false);
}
private void psoRun()
{
this.pauseFlag = false;
this.runDoneFlag = false; // 暂停和停止
this.iterationCount = 0; //迭代计数 初始为0
setPSOParameters(); //设置参数
this.psoPara.getPopulationSize();
this.psoPara.getFunctionDimension();
this.psoPara.getMaximumVelocity();
this.psoPara.getInitialWeight();
this.psoPara.getMaximumGeneration();
this.leftInitialRange[0] = 12;
this.leftInitialRange[1] = 60;
this.leftInitialRange[2] = 8;
this.leftInitialRange[3] = -115;
this.leftInitialRange[4] = 20;
this.leftInitialRange[5] = 13;
this.leftInitialRange[6] = 15;
this.rightInitialRange[0] = 14;
this.rightInitialRange[1] = 100;
this.rightInitialRange[2] = 12;
this.rightInitialRange[3] = -100;
this.rightInitialRange[4] = 24;
this.rightInitialRange[5] = 18;
this.rightInitialRange[6] = 25;
GUIParameterDialog localGUIParameterDialog = new GUIParameterDialog([color=Red]this, this.psoPara);
localGUIParameterDialog.show(); [/color]
}
public void setPSOParameters() //定义前面的setPSOParameters
{
this.psoPara.setInitialWeight(Float.valueOf(this.initialWeight).floatValue());
this.psoPara.setPopulationSize(Integer.valueOf(this.populationSize).intValue());
this.psoPara.setMaximumPosition(Double.valueOf(this.positionMaximum).doubleValue());
this.psoPara.setMaximumVelocity(Float.valueOf(this.velocityMaximum).floatValue());
this.psoPara.setXIndex(Integer.valueOf(this.xIndex).intValue());
this.psoPara.setYIndex(Integer.valueOf(this.yIndex).intValue());
this.psoPara.setDisplayStepSize(Integer.valueOf(this.displayStepSize).intValue());
this.psoPara.setMaximumGeneration(Integer.valueOf(this.iterationMaximum).intValue());
this.psoPara.setFunctionName(this.functionName);
this.psoPara.setFunctionDimension(Integer.valueOf(this.functionDimension).intValue());
}