I have a question about court-appointed public defenders: what exactly is the criteria for obtaining one? Is it ONLY if you can't afford an attorney or is it that and/or if you can't find someone to take your case? If the only criteria is that you can't afford an attorney, what's the income cutoff used? If you were to hire an attorney with, say, two weeks before a court date, is that enough time for an attorney to prepare or do they need more notice?

Asking for a friend. (No, really - I have zero familiarity with the court system and have absolutely no idea what advice to give.)