I tried the following code and get the error message shown in the comment.
I do not understand what the following explanation/hint means :
"Instances must be obtained from a suitable factory or query method."
What is a factory or query method ?
Time isn't Money, Money is Time.
The man who works looses his time ( spanish proverb )
Side note: that first line is useless. After the first line you overwrite the value of fontnames before using its previous contents. Even worse, it has in fact a negative impact. You create a String array with 10,000 elements. Although the elements are all null, there still is space for 10,000 elements.