Element f = simulator.getObject("el00242"); Element point = simulator.getObject("el00826"); Element sp1 = simulator.getObject("el00248"); Element sp2 = simulator.getObject("el00251"); Element sp3 = simulator.getObject("el00254"); Element sp4 = simulator.getObject("el00258"); Element spx = simulator.getObject("el00711"); Element tf = simulator.getObject("el00717"); tf.setEnabled(false); tf.update(); //Element b = simulator.getObject("el00257"); String command; double a,b,A,B,x,y; while (true) { command = simulator.getNextEvent(); if (command.equals("buttonClick") || command.equals("abscChange")) { a=sp1.getDouble("Value"); b=sp2.getDouble("Value"); A=sp3.getDouble("Value"); B=sp4.getDouble("Value"); //n=sp5.getDouble("Value"); f.set("Function", A+ "*ln(" +a+ "*x+" +b+ ")+" +B); f.update(); } if (command.equals("textChanged") || command.equals("abscChange") || command.equals("buttonClick")) { x=spx.getDouble("Value"); point.set("Var1",x); if(a*x+b<=0) { point.setVisibility(false); tf.set("Caption","undef"); } else { y=A*java.lang.Math.log(a*x+b)+B; point.set("Var2",y); point.setVisibility(true); tf.set("Caption",DecUtil.fString(y,2)); } point.update(); //y=point.getDouble("Var2"); //tf.set("Caption",DecUtil.fString(y,2)); tf.update(); } Thread.sleep(100); }