zbz.lvlv zbz.lvlv - 1 year ago 207
Java Question

How to Change Font Size in drawString Java

How to make the font size bigger in

g.drawString("Hello World",10,10);

Answer Source
g.setFont(new Font("TimesRoman", Font.PLAIN, fontSize)); 

Where fontSize is a int. The API for drawString states that the x and y parameters are coordinates, and have nothing to do with the size of the text.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download