Java:
public void actionPerformed(ActionEvent e) {
File quelle = new File(fquelle.getText());
if(!(fziel.getText().isEmpty())) {
fziel.setBackground(Color.WHITE);
}else{
fziel.setBackground(Color.RED);
lstatus.setText("Bitte alle Felder ausfüllen!");
}
if(!(fquelle.getText().isEmpty())) {
fquelle.setBackground(Color.WHITE);
}else{
fquelle.setBackground(Color.RED);
lstatus.setText("Bitte alle Felder ausfüllen!");
}
if(!(fordner.getText().isEmpty())) {
fordner.setBackground(Color.WHITE);
}else{
fordner.setBackground(Color.RED);
lstatus.setText("Bitte alle Felder ausfüllen!");
}
if(fordner.getBackground().equals(Color.WHITE) && fziel.getBackground().equals(Color.WHITE) && fquelle.getBackground().equals(Color.WHITE)){
lstatus.setText("arbeitet...");
searchFile(quelle, fordner.getText());
lstatus.setText("Fertig!");
}
}
Problem: Das Status label zeigt alles an, bis auf "arbeitet..."
Weil die Methode searchFile() dauert oftmals ein bisschen, und deswegen will ich, dass dann in der GUI das Jlabel geändert wird zu "arbeitet..." und danach zu "fertig".