Element f = simulator.getObject("el00242"); Element point = simulator.getObject("el00593"); Element sp1 = simulator.getObject("el00248"); Element sp2 = simulator.getObject("el00251"); Element spx = simulator.getObject("el00481"); Element tf = simulator.getObject("el00488"); tf.setEnabled(false); tf.update(); /*Element ts2 = simulator.getObject("Text shape_0002"); physicon.dsi.shapes.TTextShape ord = (physicon.dsi.shapes.TTextShape)ts2.getElement();*/ String command; double a,b,x,y; while (true) { command = simulator.getNextEvent(); if (command.equals("buttonClick") || command.equals("abscChange")) { a=sp1.getDouble("Value"); b=sp2.getDouble("Value"); f.set("Function", a+ "/x+" +b); f.update(); } if (command.equals("textChanged") || command.equals("abscChange") || command.equals("buttonClick")) { x=spx.getDouble("Value"); point.set("Var1",x); if(x==0) { point.setVisibility(false); tf.set("Caption","undef"); } else { y=a/x+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); }