Texfields updating all at one at the end.
Hey.
Im trying to get a series of Textfields to update their values using textfield.setText(""); The setText's are within a function that draws a line, then calls the setText, then pauses for a second (either in a for loop, or a thread.sleep), then repeats the process multiple times, drawing new lines and seting different textfields.
The probem im having is that the lines are drawn in sequence with the correct spacings, but the textfields are only updated, as one mass right at the end.
I want them updated as the lines are drawn. Here is some of my code:
public void animate() {
System.out.println("in cheese");
comp2D.setColor(Color.red);
drawBresenhamLine one = new drawBresenhamLine(comp2D, 70, 190, 150, 110);
Layout6.tables.vertex.no1.setText("99");
Layout6.sleep();
comp2D.setColor(Color.black);
drawBresenhamLine two = new drawBresenhamLine(comp2D, 70, 190, 150, 110);
comp2D.setColor(Color.red);
drawBresenhamLine three = new drawBresenhamLine(comp2D, 150, 110, 150, 190);
Layout6.tables.vertex.x1.setText("50");
Layout6.sleep();
comp2D.setColor(Color.black);
drawBresenhamLine four = new drawBresenhamLine(comp2D, 150, 110, 150, 190);
comp2D.setColor(Color.red);
drawBresenhamLine five = new drawBresenhamLine(comp2D, 150, 190, 70, 190);
Layout6.tables.vertex.y1.setText("33");
Layout6.sleep();
comp2D.setColor(Color.black);
drawBresenhamLine six = new drawBresenhamLine(comp2D, 150, 190, 70, 190);
comp2D.setColor(Color.red);
drawBresenhamLine seven = new drawBresenhamLine(comp2D, 150, 110, 320, 110);
IS there a way to force the panel that holds the texfields to update, or to force the textfields to update.
I have tried the above code in many ways, including calling the setText within the panel that holds the texfields, but it did not change anything. It will only ever update at the end of public void animate.
Thanks
Mark

