Firstly, I'm sorry for my bad english. I wrote my problem in the forums that speak my language. But I did not get an answer. I hope you can help me.
When I write the for loop, the System.out.println()
or JTextArea.setText()
command starts to work when the loop is over. Part of my codes:
for(int pixelCount = 0;pixelCount<pixelLength;pixelCount++){
System.out.println("Progress..:"+pixelCount+"/"+pixelLength);
int x = pixelCount%Image.getWidth();
int y = pixelCount/Image.getWidth();
if(isChange==1){
if(new Color(Image.getRGB(x, y)).getRed()%2==0){
Image.setRGB(x, y,new Color(new Color(Image.getRGB(x, y)).getRed()+1,
new Color(Image.getRGB(x, y)).getGreen(),
new Color(Image.getRGB(x, y)).getBlue(),
new Color(Image.getRGB(x, y)).getAlpha()).getRGB());}
}
The loop is sometimes very long. So I print it on the screen to see the progress of the loop. The loop starts when I press the button. But when I press the button, the System.out.println() command looks afterwards.
EDIT: How should I write the progress in the loop?
EDIT: I solved the problem, friends. The System.out.println () command works fine. There is a replace command before the for loop starts. The program spends time there before the for loop starts. Thanks everyone who took the time and helped me