If programm doesn't find a valid solution after ten times a JDialog appears.