• No replies
210 Posts

Pinned topic Code does not read from text box in applet and the applet is slow

‏2008-04-24T08:31:58Z |

Just wondered if someone could kindly spare a few minutes to help me (a beginner of JAVA) by checking the attached applet and

(1) see why the text box (TextField) entries are not read by the code in this traffic light simulation. The variables assigned to the six text boxes are var1,var2,...,var6.

(2) Also, the applet is extremely slow to run and how can I improve that please?

What I am trying to do is to read the input from text boxes as the traffic volumes in each direction (say 25 cars) and then set the timing for each direction's GREEN light accordingly. In case you would need, th variable named STATE (changing as 10,15,20,25,..) defines the current state of the traffic light sequence, i.e. which roads get GREEN.

Many thanks in advance.