|
Java™ by example!
|
|
|
How do I draw a string in a certain font?
 Use the method drawString that accepts the String and the x and y parameter. Be aware that the x and y coordinates refer to the baseline, so from the bottom up. If you prefer working from the top down, you can get the font ascent (from the API: the distance between the font's baseline and the top of most alphanumerical characters) and add it to the y coordinate:
Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|