AWT Label

Change Text Font Of Label Example

Example Output

Want to learn quickly?
Try one of the many quizzes. More than Java 400 questions with detailed answers.

Add Comment

  • It does not work anymore. 🙁
    Whenever I try this I get the following error: “The method setFont(javafx.scene.text.Font) in the type Labeled is not applicable for the arguments (java.awt.Font)”. The fragment that produces this output is this one:

    Font miFuente1 = new Font(“Serif”, Font.BOLD, 36);
    Label label = new Label();
    label.setFont(miFuente1);

Sponsors

Facebook Fans